X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.c%2Fpr32362-1.c;fp=libgomp%2Ftestsuite%2Flibgomp.c%2Fpr32362-1.c;h=3c62d4bdb269a2af672d5ef949dc43e04ae4f1f8;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.c/pr32362-1.c b/libgomp/testsuite/libgomp.c/pr32362-1.c new file mode 100644 index 00000000..3c62d4bd --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr32362-1.c @@ -0,0 +1,32 @@ +/* PR middle-end/32362 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#include +#include + +int +main () +{ + int n[4] = { -1, -1, -1, -1 }; + static int a = 2, b = 4; + omp_set_num_threads (4); + omp_set_dynamic (0); + omp_set_nested (1); +#pragma omp parallel private(b) + { + b = omp_get_thread_num (); +#pragma omp parallel firstprivate(a) + { + a = (omp_get_thread_num () + a) + 1; + if (b == omp_get_thread_num ()) + n[omp_get_thread_num ()] = a + (b << 4); + } + } + if (n[0] != 3) + abort (); + if (n[3] != -1 + && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36)) + abort (); + return 0; +}