Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / pr100059-1.c
blobaf12295541a2671f8edc26c2d437abcd1954c155
1 /* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c. */
3 #define N 1024
4 int a[N], b[N], c[N];
5 int i = 0;
7 void
8 update ()
9 {
10 for (i = 0; i < N; i++)
12 a[i] += 1;
13 b[i] += 2;
14 c[i] += 3;
18 #pragma omp declare target
19 #pragma omp declare target link(a,c,b,i)
20 #pragma omp declare target to(update)
21 #pragma omp end declare target
23 int
24 main ()
26 for (i = 0; i < N; i++)
28 a[i] = i;
29 b[i] = i + 1;
30 c[i] = i + 2;
33 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
35 #pragma omp target map(to: i) map(tofrom: a, b, c)
37 update(); /* Device. */
40 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
42 for (i = 0; i < N; i++)
43 if ( a[i] != i + 1 || b[i] != i + 3 || c[i] != i + 5)
44 __builtin_abort();
46 update(); /* Host. */
48 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
50 for (i = 0; i < N; i++)
51 if ( a[i] != i + 2 || b[i] != i + 5 || c[i] != i + 8)
52 __builtin_abort ();
54 return 0;