1 #include <omp.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4
5 int zero;
6
7 omp_allocator_handle_t
8 allocator (omp_allocator_handle_t h)
9 {
10 if (zero)
11 return h;
12 else
13 abort ();
14 }
15
16 omp_allocator_handle_t
17 align (int a)
18 {
19 if (zero)
20 return omp_default_mem_alloc;
21 else
22 abort ();
23 }
24
25 int
26 main ()
27 {
28 int x = 1, y = 2;
29 #pragma omp parallel num_threads(2) firstprivate (x, y) allocate (allocator (omp_default_mem_alloc) : x) allocate (align (16) : y)
30 {
31 if (x != 1 || y != 2)
32 abort ();
33 if ((((uintptr_t) &y) & 15) != 0)
34 abort ();
35 }
36 return 0;
37 }