1 /* PR middle-end/27388 */
2 /* { dg-do compile } */
3 /* { dg-options "-fopenmp -fdump-tree-omplower" } */
4
5 extern void baz (int);
6
7 void
foo(void)8 foo (void)
9 {
10 int i;
11 #pragma omp parallel for shared (i)
12 for (i = 0; i < 2; i++)
13 baz (i);
14 }
15
16 void
bar(void)17 bar (void)
18 {
19 int j = 0;
20 #pragma omp parallel shared (j)
21 {
22 j++;
23 #pragma omp for
24 for (j = 0; j < 2; j++)
25 baz (j);
26 }
27 }
28
29 /* { dg-final { scan-tree-dump-times "shared\\\(i\\\)\[^\\n\]*private\\\(i\\\)" 0 "omplower" } } */
30 /* { dg-final { scan-tree-dump-times "private\\\(i\\\)\[^\\n\]*shared\\\(i\\\)" 0 "omplower" } } */
31 /* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private\\\(i\\\)" 1 "omplower" } } */
32 /* { dg-final { scan-tree-dump-times "shared\\\(j\\\)\[^\\n\]*private\\\(j\\\)" 0 "omplower" } } */
33 /* { dg-final { scan-tree-dump-times "private\\\(j\\\)\[^\\n\]*shared\\\(j\\\)" 0 "omplower" } } */
34 /* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private\\\(j\\\)" 1 "omplower" } } */
35 /* { dg-final { cleanup-tree-dump "omplower" } } */
36