view gcc/testsuite/gcc.dg/gomp/declare-variant-2.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* Test parsing of #pragma omp declare variant */
/* { dg-do compile } */

int f0 (int, int *, int);

int
f1 (int x)
{
  if (x)
    #pragma omp declare variant (fn0) match (user={condition(0)})
    extern int f3 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
  while (x < 10)
    #pragma omp declare variant (fn0) match (user={condition(0)})
    extern int f4 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
  {
lab:
    #pragma omp declare variant (fn0) match (user={condition(0)})
    extern int f5 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
    x++;					/* { dg-error "expected expression before" "" { target *-*-* } .-1 } */
  }
  return x;
}