Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.c / target-13.c
blob168850b507c01e917b83276c9a1500fd6944ee1f
1 #ifdef __cplusplus
2 extern "C"
3 #else
4 extern
5 #endif
6 void abort (void);
7 struct S { int s, t; };
9 void
10 foo ()
12 int x = 5, y = 6, err = 0;
13 struct S u = { 7, 8 }, v = { 9, 10 };
14 double s = 11.5, t = 12.5;
15 #pragma omp target private (x, u, s) firstprivate (y, v, t) map(from:err)
17 x = y;
18 u = v;
19 s = t;
20 err = (x != 6 || y != 6
21 || u.s != 9 || u.t != 10 || v.s != 9 || v.t != 10
22 || s != 12.5 || t != 12.5);
23 x += 1;
24 y += 2;
25 u.s += 3;
26 v.t += 4;
27 s += 2.5;
28 t += 3.0;
29 if (x != 7 || y != 8
30 || u.s != 12 || u.t != 10 || v.s != 9 || v.t != 14
31 || s != 15.0 || t != 15.5)
32 err = 1;
34 if (err || x != 5 || y != 6
35 || u.s != 7 || u.t != 8 || v.s != 9 || v.t != 10
36 || s != 11.5 || t != 12.5)
37 abort ();
40 int
41 main ()
43 foo ();
44 return 0;