view gcc/testsuite/c-c++-common/pr81052.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
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