PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/gcc/testsuite/gcc.dg/gomp/pr27388-2.c

https://gitlab.com/sortix/gcc
C | 35 lines | 21 code | 4 blank | 10 comment | 3 complexity | 378b0d7e23d2ea5a426ff7ee8711a55a MD5 | raw file
 1/* PR middle-end/27388 */
 2/* { dg-do compile } */
 3/* { dg-options "-fopenmp -fdump-tree-omplower" } */
 4
 5extern void baz (int);
 6
 7void
 8foo (void)
 9{
10  int i;
11#pragma omp parallel for shared (i)
12  for (i = 0; i < 2; i++)
13    baz (i);
14}
15
16void
17bar (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" } } */