Merge C++ from gomp-20050608-branch.
[official-gcc.git] / gcc / testsuite / g++.dg / gomp / critical-1.C
blobbdc7bad7b823de5bbf6743dbf064089e02fad036
1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -fdump-tree-omplower" } */
4 extern void bar(int);
6 void foo (void)
8   #pragma omp critical
9     bar(0);
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   }
19   #pragma omp critical
20   #pragma omp critical(foo)
21     bar(3);
24 /* { dg-final { scan-tree-dump-times "GOMP_critical_start" 2 "omplower" } } */
25 /* { dg-final { scan-tree-dump-times "GOMP_critical_end" 2 "omplower" } } */
26 /* { dg-final { scan-tree-dump-times "GOMP_critical_name_start" 2 "omplower" } } */
27 /* { dg-final { scan-tree-dump-times "GOMP_critical_name_end" 2 "omplower" } } */
28 /* { dg-final { cleanup-tree-dump "omplower" } } */