Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / private-atomic-1.c
blob2f9e6f2d8a5de7f8ffeef6b08ab58b55eea62ab1
1 // 'atomic' access of thread-private variable
3 /* { dg-additional-options "-fopt-info-note-omp" }
4 { dg-additional-options "--param=openacc-privatization=noisy" }
5 { dg-additional-options "-foffload=-fopt-info-note-omp" }
6 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
7 for testing/documenting aspects of that functionality. */
9 #include <assert.h>
11 int main (void)
13 int res;
15 res = 0;
16 #pragma acc parallel reduction(+: res)
17 /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
19 #pragma acc loop vector reduction(+: res)
20 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
21 /* { dg-note {variable 'v' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } .-2 }
22 { dg-note {variable 'v' ought to be adjusted for OpenACC privatization level: 'vector'} "" { target *-*-* } .-3 }
23 { dg-note {variable 'v' adjusted for OpenACC privatization level: 'vector'} "" { target { ! openacc_host_selected } } .-4 } */
24 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-5 } */
25 for (int i = 0; i < 2322; i++)
27 int v = -222;
29 #pragma acc loop seq
30 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
31 for (int j = 0; j < 121; ++j)
33 #pragma acc atomic update
34 ++v;
37 res += (v == -222 + 121);
40 assert (res == 2322);
42 return 0;