2015-11-30 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / libgomp / testsuite / libgomp.c++ / for-14.C
blob7738473b6011fcd1a5fea0d23ff3930f2151e5a6
1 extern "C" void abort ();
3 #define M(x, y, z) O(x, y, z)
4 #define O(x, y, z) x ## _ ## y ## _ ## z
6 #pragma omp declare target
8 #define F for
9 #define G f
10 #define S
11 #define N(x) M(x, G, normal)
12 #include "../libgomp.c/for-2.h"
13 #undef S
14 #undef N
15 #undef F
16 #undef G
18 #pragma omp end declare target
20 #undef OMPTGT
21 #undef OMPFROM
22 #undef OMPTO
23 #define DO_PRAGMA(x) _Pragma (#x)
24 #define OMPTGT DO_PRAGMA (omp target)
25 #define OMPFROM(v) DO_PRAGMA (omp target update from(v))
26 #define OMPTO(v) DO_PRAGMA (omp target update to(v))
28 #define F teams distribute
29 #define G td
30 #define S
31 #define N(x) M(x, G, normal)
32 #include "../libgomp.c/for-2.h"
33 #undef S
34 #undef N
35 #undef F
36 #undef G
38 #define F teams distribute
39 #define G td_ds128
40 #define S dist_schedule(static, 128)
41 #define N(x) M(x, G, normal)
42 #include "../libgomp.c/for-2.h"
43 #undef S
44 #undef N
45 #undef F
46 #undef G
48 #define F teams distribute simd
49 #define G tds
50 #define S
51 #define N(x) M(x, G, normal)
52 #include "../libgomp.c/for-2.h"
53 #undef S
54 #undef N
55 #undef F
56 #undef G
58 #define F teams distribute simd
59 #define G tds_ds128
60 #define S dist_schedule(static, 128)
61 #define N(x) M(x, G, normal)
62 #include "../libgomp.c/for-2.h"
63 #undef S
64 #undef N
65 #undef F
66 #undef G
68 #define F teams distribute parallel for
69 #define G tdpf
70 #include "../libgomp.c/for-1.h"
71 #undef F
72 #undef G
74 #define F teams distribute parallel for dist_schedule(static, 128)
75 #define G tdpf_ds128
76 #include "../libgomp.c/for-1.h"
77 #undef F
78 #undef G
80 #define F teams distribute parallel for simd
81 #define G tdpfs
82 #include "../libgomp.c/for-1.h"
83 #undef F
84 #undef G
86 #define F teams distribute parallel for simd dist_schedule(static, 128)
87 #define G tdpfs_ds128
88 #include "../libgomp.c/for-1.h"
89 #undef F
90 #undef G
92 int
93 main ()
95   if (test_td_normal ()
96       || test_td_ds128_normal ()
97       || test_tds_normal ()
98       || test_tds_ds128_normal ()
99       || test_tdpf_static ()
100       || test_tdpf_static32 ()
101       || test_tdpf_auto ()
102       || test_tdpf_guided32 ()
103       || test_tdpf_runtime ()
104       || test_tdpf_ds128_static ()
105       || test_tdpf_ds128_static32 ()
106       || test_tdpf_ds128_auto ()
107       || test_tdpf_ds128_guided32 ()
108       || test_tdpf_ds128_runtime ()
109       || test_tdpfs_static ()
110       || test_tdpfs_static32 ()
111       || test_tdpfs_auto ()
112       || test_tdpfs_guided32 ()
113       || test_tdpfs_runtime ()
114       || test_tdpfs_ds128_static ()
115       || test_tdpfs_ds128_static32 ()
116       || test_tdpfs_ds128_auto ()
117       || test_tdpfs_ds128_guided32 ()
118       || test_tdpfs_ds128_runtime ())
119     abort ();