Skip to content

Commit 8aa61d8

Browse files
committed
Add check with specified alignment
Signed-off-by: James Brodman <[email protected]>
1 parent 15e1fd2 commit 8aa61d8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sycl/test/usm/badmalloc.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,18 @@ int main(int argc, char *argv[]) {
4141
p = malloc(-1, q, usm::alloc::unknown);
4242
assert(p == nullptr);
4343

44+
// Bad combos for aligned
45+
p = aligned_alloc(1, 0, q, usm::alloc::host);
46+
assert(p == nullptr);
47+
48+
p = aligned_alloc(1, 0, q, usm::alloc::device);
49+
assert(p == nullptr);
50+
51+
p = aligned_alloc(1, 0, q, usm::alloc::shared);
52+
assert(p == nullptr);
53+
54+
p = aligned_alloc(1, 0, q, usm::alloc::unknown);
55+
assert(p == nullptr);
56+
4457
return 0;
4558
}

0 commit comments

Comments
 (0)