blob: 93978208002533833aad39a4d91ec7e532180e91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/* Test parsing of #pragma omp declare simd */
/* { dg-do compile } */
/* { dg-options "-std=c17 -fopenmp -pedantic-errors" } */
int
f1 (int x)
{
if (x)
#pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
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 simd simdlen (8) aligned (b : 8 * sizeof (int))
extern int f4 (int a, int *b, int c); /* { dg-error "must be followed by function declaration or definition" } */
{
lab:
#pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
extern int f5 (int a, int *b, int c); /* { dg-error "must be followed by function declaration or definition" } */
x++;
}
return x;
}
int
f2 (int x)
{
if (x)
extern int f6 (int a, int *b, int c); /* { dg-error "expected expression before" } */
while (x < 10)
extern int f7 (int a, int *b, int c); /* { dg-error "expected expression before" } */
{
lab:
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" } */
x++;
}
return x;
}
|