1 #include <omp.h>
2 #include <stdlib.h>
3
4 const omp_alloctrait_t traits[]
5 = { { omp_atk_pool_size, 1 },
6 { omp_atk_fallback, omp_atv_abort_fb } };
7
8 int
9 main ()
10 {
11 omp_allocator_handle_t a;
12
13 if (omp_alloc (0, omp_null_allocator) != NULL)
14 abort ();
15 if (omp_aligned_alloc (64, 0, omp_null_allocator) != NULL)
16 abort ();
17 if (omp_calloc (0, 0, omp_null_allocator) != NULL
18 || omp_calloc (32, 0, omp_null_allocator) != NULL
19 || omp_calloc (0, 64, omp_null_allocator) != NULL)
20 abort ();
21 if (omp_aligned_calloc (32, 0, 0, omp_null_allocator) != NULL
22 || omp_aligned_calloc (64, 32, 0, omp_null_allocator) != NULL
23 || omp_aligned_calloc (16, 0, 64, omp_null_allocator) != NULL)
24 abort ();
25 a = omp_init_allocator (omp_default_mem_space, 2, traits);
26 if (a != omp_null_allocator)
27 {
28 if (omp_alloc (0, a) != NULL
29 || omp_alloc (0, a) != NULL
30 || omp_alloc (0, a) != NULL
31 || omp_aligned_alloc (16, 0, a) != NULL
32 || omp_aligned_alloc (128, 0, a) != NULL
33 || omp_calloc (0, 0, a) != NULL
34 || omp_calloc (32, 0, a) != NULL
35 || omp_calloc (0, 64, a) != NULL
36 || omp_aligned_calloc (32, 0, 0, a) != NULL
37 || omp_aligned_calloc (64, 32, 0, a) != NULL
38 || omp_aligned_calloc (16, 0, 64, a) != NULL)
39 abort ();
40 omp_destroy_allocator (a);
41 }
42 return 0;
43 }