aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/declare-variant-2.c
blob: 3da5dc7bd0c749e12d762bde975327e763078a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Test parsing of #pragma omp declare variant */
/* { dg-do compile } */
/* { dg-options "-std=c17 -fopenmp -pedantic-errors" } */

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++;
  }
  return x;
}