1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -fdump-tree-ompexp" } */
3
4 extern void bar(int);
5
foo(void)6 void foo (void)
7 {
8 #pragma omp critical
9 bar(0);
10
11 /* Note that "name" is in its own namespace, thus this foo is not
12 the same as the function. */
13 #pragma omp critical(foo)
14 {
15 bar(1);
16 bar(2);
17 }
18
19 #pragma omp critical
20 #pragma omp critical(foo)
21 bar(3);
22 }
23
24 /* { dg-final { scan-tree-dump-times "GOMP_critical_start" 2 "ompexp" } } */
25 /* { dg-final { scan-tree-dump-times "GOMP_critical_end" 2 "ompexp" } } */
26 /* { dg-final { scan-tree-dump-times "GOMP_critical_name_start" 2 "ompexp" } } */
27 /* { dg-final { scan-tree-dump-times "GOMP_critical_name_end" 2 "ompexp" } } */
28