view gcc/testsuite/c-c++-common/pr81052.c @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* PR middle-end/81052 */
/* { dg-do compile } */
/* { dg-options "-fopenmp-simd -O2" } */

int
foo (int x, int y)
{
  int i;
#pragma omp simd
  for (i = x; i < y; ++i)
    return 0;			/* { dg-error "invalid branch to/from OpenMP structured block" } */
  return 1;
}

#ifdef __cplusplus
template <typename T>
T
bar (T x, T y)
{
  T i;
#pragma omp simd
  for (i = x; i < y; ++i)
    return 0;			/* { dg-error "invalid branch to/from OpenMP structured block" "" { target c++ } } */
  return 1;
}

int x = bar (1, 7);
#endif