Skip to content

Commit 278306b

Browse files
committed
Add aligned_alloc calls to test.
Signed-off-by: James Brodman <[email protected]>
1 parent 732f569 commit 278306b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

sycl/test/usm/badmalloc.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,26 @@ int main(int argc, char *argv[]) {
2828
// Bad size, host
2929
p = malloc(-1, q, usm::alloc::host);
3030
assert(p == nullptr);
31-
32-
// Bad size, device
3331
p = malloc(-1, q, usm::alloc::device);
3432
assert(p == nullptr);
35-
36-
// Bad size, shared
3733
p = malloc(-1, q, usm::alloc::shared);
3834
assert(p == nullptr);
39-
40-
// Bad size, unknown
4135
p = malloc(-1, q, usm::alloc::unknown);
4236
assert(p == nullptr);
4337

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+
4452
return 0;
4553
}

0 commit comments

Comments
 (0)