gcc/
[official-gcc.git] / libgomp / testsuite / libgomp.c / for-3.c
blobf4cd115eefab94673e010cd065b0d5937546c36a
1 /* { dg-additional-options "-std=gnu99" } */
3 extern void abort ();
5 #define M(x, y, z) O(x, y, z)
6 #define O(x, y, z) x ## _ ## y ## _ ## z
8 #pragma omp declare target
10 #define F distribute
11 #define G d
12 #define S
13 #define N(x) M(x, G, normal)
14 #include "for-2.h"
15 #undef S
16 #undef N
17 #undef F
18 #undef G
20 #define F distribute
21 #define G d_ds128
22 #define S dist_schedule(static, 128)
23 #define N(x) M(x, G, normal)
24 #include "for-2.h"
25 #undef S
26 #undef N
27 #undef F
28 #undef G
30 #define F distribute simd
31 #define G ds
32 #define S
33 #define N(x) M(x, G, normal)
34 #include "for-2.h"
35 #undef S
36 #undef N
37 #undef F
38 #undef G
40 #define F distribute simd
41 #define G ds_ds128
42 #define S dist_schedule(static, 128)
43 #define N(x) M(x, G, normal)
44 #include "for-2.h"
45 #undef S
46 #undef N
47 #undef F
48 #undef G
50 #define F distribute parallel for
51 #define G dpf
52 #include "for-1.h"
53 #undef F
54 #undef G
56 #define F distribute parallel for dist_schedule(static, 128)
57 #define G dpf_ds128
58 #include "for-1.h"
59 #undef F
60 #undef G
62 #define F distribute parallel for simd
63 #define G dpfs
64 #include "for-1.h"
65 #undef F
66 #undef G
68 #define F distribute parallel for simd dist_schedule(static, 128)
69 #define G dpfs_ds128
70 #include "for-1.h"
71 #undef F
72 #undef G
74 #pragma omp end declare target
76 int
77 main ()
79 int err = 0;
80 #pragma omp target teams reduction(|:err)
82 err |= test_d_normal ();
83 err |= test_d_ds128_normal ();
84 err |= test_ds_normal ();
85 err |= test_ds_ds128_normal ();
86 err |= test_dpf_static ();
87 err |= test_dpf_static32 ();
88 err |= test_dpf_auto ();
89 err |= test_dpf_guided32 ();
90 err |= test_dpf_runtime ();
91 err |= test_dpf_ds128_static ();
92 err |= test_dpf_ds128_static32 ();
93 err |= test_dpf_ds128_auto ();
94 err |= test_dpf_ds128_guided32 ();
95 err |= test_dpf_ds128_runtime ();
96 err |= test_dpfs_static ();
97 err |= test_dpfs_static32 ();
98 err |= test_dpfs_auto ();
99 err |= test_dpfs_guided32 ();
100 err |= test_dpfs_runtime ();
101 err |= test_dpfs_ds128_static ();
102 err |= test_dpfs_ds128_static32 ();
103 err |= test_dpfs_ds128_auto ();
104 err |= test_dpfs_ds128_guided32 ();
105 err |= test_dpfs_ds128_runtime ();
107 if (err)
108 abort ();
109 return 0;