Skip various cmp-mem-const tests on lp64 hppa*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / struct-elem-1.c
blob5f40fd7830c59f837e22aa4b9a8772415eba227d
1 #include <omp.h>
2 #include <stdlib.h>
4 struct S
6 int a, b;
7 };
8 typedef struct S S;
10 int main (void)
12 int d = omp_get_default_device ();
13 int id = omp_get_initial_device ();
15 if (d < 0 || d >= omp_get_num_devices ())
16 d = id;
18 S s;
19 #pragma omp target enter data map (alloc: s.a, s.b)
20 #pragma omp target exit data map (release: s.b)
22 /* OpenMP 5.0 structure element mapping rules describe that elements of same
23 structure variable should allocate/deallocate in a uniform fashion, so
24 "s.a" should be removed together by above 'exit data'. */
25 if (d != id && omp_target_is_present (&s.a, d))
26 abort ();
28 return 0;