2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / c-c++-common / pr81052.c
blob6bc2879951e9f1834799018cd109dba7eca1fa24
1 /* PR middle-end/81052 */
2 /* { dg-do compile } */
3 /* { dg-options "-fopenmp-simd -O2" } */
5 int
6 foo (int x, int y)
8 int i;
9 #pragma omp simd
10 for (i = x; i < y; ++i)
11 return 0; /* { dg-error "invalid branch to/from OpenMP structured block" } */
12 return 1;
15 #ifdef __cplusplus
16 template <typename T>
18 bar (T x, T y)
20 T i;
21 #pragma omp simd
22 for (i = x; i < y; ++i)
23 return 0; /* { dg-error "invalid branch to/from OpenMP structured block" "" { target c++ } } */
24 return 1;
27 int x = bar (1, 7);
28 #endif