File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -23,31 +23,41 @@ int main(int argc, char *argv[]) {
23
23
24
24
// Good size, bad type
25
25
auto p = malloc (8 , q, usm::alloc::unknown);
26
- assert (p == nullptr );
26
+ if (p != nullptr )
27
+ return 1 ;
27
28
28
29
// Bad size, host
29
30
p = malloc (-1 , q, usm::alloc::host);
30
- assert (p == nullptr );
31
+ if (p != nullptr )
32
+ return 2 ;
31
33
p = malloc (-1 , q, usm::alloc::device);
32
- assert (p == nullptr );
34
+ if (p != nullptr )
35
+ return 3 ;
33
36
p = malloc (-1 , q, usm::alloc::shared);
34
- assert (p == nullptr );
37
+ if (p != nullptr )
38
+ return 4 ;
35
39
p = malloc (-1 , q, usm::alloc::unknown);
36
- assert (p == nullptr );
40
+ if (p != nullptr )
41
+ return 5 ;
37
42
38
43
// Bad size, auto aligned
39
44
p = aligned_alloc (0 , -1 , q, usm::alloc::host);
40
- assert (p == nullptr );
45
+ if (p != nullptr )
46
+ return 6 ;
41
47
p = aligned_alloc (0 , -1 , q, usm::alloc::device);
42
- assert (p == nullptr );
48
+ if (p != nullptr )
49
+ return 7 ;
43
50
p = aligned_alloc (0 , -1 , q, usm::alloc::shared);
44
- assert (p == nullptr );
51
+ if (p != nullptr )
52
+ return 8 ;
45
53
p = aligned_alloc (0 , -1 , q, usm::alloc::unknown);
46
- assert (p == nullptr );
54
+ if (p != nullptr )
55
+ return 9 ;
47
56
48
57
// Allocs of 0 undefined, but bad type
49
58
p = aligned_alloc (4 , 0 , q, usm::alloc::unknown);
50
- assert (p == nullptr );
59
+ if (p != nullptr )
60
+ return 10 ;
51
61
52
62
return 0 ;
53
63
}
You can’t perform that action at this time.
0 commit comments