X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.c%2Floop-10.c;fp=libgomp%2Ftestsuite%2Flibgomp.c%2Floop-10.c;h=1b42c4bf126f250083d4dad58a02c6ec53110f8e;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.c/loop-10.c b/libgomp/testsuite/libgomp.c/loop-10.c new file mode 100644 index 00000000..1b42c4bf --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-10.c @@ -0,0 +1,30 @@ +extern void abort (void); + +int i = 8; + +int main (void) +{ + int j = 7, k = 0; + #pragma omp for + for (i = 0; i < 10; i++) + ; + #pragma omp for + for (j = 0; j < 10; j++) + ; + /* OpenMP 3.0 newly guarantees that the original list items can't + be shared with the privatized omp for iterators, even when + the original list items are already private. */ + if (i != 8 || j != 7) + abort (); + #pragma omp parallel private (i) reduction (+:k) + { + i = 6; + #pragma omp for + for (i = 0; i < 10; i++) + ; + k = (i != 6); + } + if (k) + abort (); + return 0; +}