File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,26 @@ int main(int argc, char *argv[]) {
28
28
// Bad size, host
29
29
p = malloc (-1 , q, usm::alloc::host);
30
30
assert (p == nullptr );
31
-
32
- // Bad size, device
33
31
p = malloc (-1 , q, usm::alloc::device);
34
32
assert (p == nullptr );
35
-
36
- // Bad size, shared
37
33
p = malloc (-1 , q, usm::alloc::shared);
38
34
assert (p == nullptr );
39
-
40
- // Bad size, unknown
41
35
p = malloc (-1 , q, usm::alloc::unknown);
42
36
assert (p == nullptr );
43
37
38
+ // Bad size, auto aligned
39
+ p = aligned_alloc (0 , -1 , q, usm::alloc::host);
40
+ assert (p == nullptr );
41
+ p = aligned_alloc (0 , -1 , q, usm::alloc::device);
42
+ assert (p == nullptr );
43
+ p = aligned_alloc (0 , -1 , q, usm::alloc::shared);
44
+ assert (p == nullptr );
45
+ p = aligned_alloc (0 , -1 , q, usm::alloc::unknown);
46
+ assert (p == nullptr );
47
+
48
+ // Allocs of 0 undefined, but bad type
49
+ p = aligned_alloc (4 , 0 , q, usm::alloc::unknown);
50
+ assert (p == nullptr );
51
+
44
52
return 0 ;
45
53
}
You can’t perform that action at this time.
0 commit comments