Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / barrier-2.c
blob6e94d0c25c6906abde0ee2674cd8f3b683173493
1 /* { dg-do compile } */
3 void f1(void)
5 #pragma omp barrier a /* { dg-error "expected end of line" } */
8 /* OpenMP 2.5, section 2.7.3:
10 Note that because the barrier construct does not have a C language
11 statement as part of its syntax, there are some restrictions on its
12 placement within a program. The barrier directive may only be placed
13 in the program at a position where ignoring or deleting the directive
14 would result in a program with correct syntax. */
16 void f2(void)
18 label:
19 #pragma omp barrier
20 } /* { dg-error "label at end of compound statement" } */
22 void f3(_Bool p)
24 if (p)
25 #pragma omp barrier /* { dg-error "compound statements" } */