(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
gomp/
declare-simd-5.c
       1  /* Test parsing of #pragma omp declare simd */
       2  /* { dg-do compile } */
       3  /* { dg-options "-std=c17 -fopenmp -pedantic-errors" } */
       4  
       5  int
       6  f1 (int x)
       7  {
       8    if (x)
       9      #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
      10      extern int f3 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
      11    while (x < 10)
      12      #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
      13      extern int f4 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
      14    {
      15  lab:
      16      #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
      17      extern int f5 (int a, int *b, int c);	/* { dg-error "must be followed by function declaration or definition" } */
      18      x++;
      19    }
      20    return x;
      21  }
      22  
      23  int
      24  f2 (int x)
      25  {
      26    if (x)
      27      extern int f6 (int a, int *b, int c);	/* { dg-error "expected expression before" } */
      28    while (x < 10)
      29      extern int f7 (int a, int *b, int c);	/* { dg-error "expected expression before" } */
      30    {
      31  lab:
      32      extern int f8 (int a, int *b, int c);	/* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */
      33      x++;
      34    }
      35    return x;
      36  }