Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / declare-simd-2.c
blobc0a42a2ef465c67ba11881002921eaff7585c2cf
1 /* Test parsing of #pragma omp declare simd */
2 /* { dg-do compile } */
4 #pragma omp declare simd
5 int a; /* { dg-error "not immediately followed by a function declaration or definition" } */
7 #pragma omp declare simd
8 int fn1 (int a), fn2 (int a); /* { dg-error "not immediately followed by a single function declaration or definition" } */
10 #pragma omp declare simd
11 int b, fn3 (int a); /* { dg-error "not immediately followed by a function declaration or definition" } */
13 #pragma omp declare simd linear (a)
14 int fn4 (int a), c; /* { dg-error "not immediately followed by a function declaration or definition" } */
16 int t;
18 #pragma omp declare simd
19 #pragma omp declare simd
20 #pragma omp threadprivate(t) /* { dg-error "must be followed by function declaration or definition or another" } */
21 int fn5 (int a);
23 #pragma omp declare simd inbranch notinbranch /* { dg-error "clause is incompatible with" } */
24 int fn6 (int);
26 #pragma omp declare simd aligned (a, b)
27 int fn7 (int *a, int b[64]);
29 #pragma omp declare simd aligned (a) /* { dg-error "neither a pointer nor an array" } */
30 int fn8 (int a);
32 #pragma omp declare simd aligned (c) /* { dg-error "neither a pointer nor an array" } */
33 int fn9 (float c);
35 #pragma omp declare simd aligned (d) /* { dg-error "neither a pointer nor an array" } */
36 int fn10 (double d);
38 struct D { int d; };
40 #pragma omp declare simd aligned (e) /* { dg-error "neither a pointer nor an array" } */
41 int fn11 (struct D e);
43 #pragma omp declare simd linear(a:7) uniform(a) /* { dg-error "appears more than once" } */
44 int f12 (int a);
45 #pragma omp declare simd linear(a) linear(a) /* { dg-error "appears more than once" } */
46 int f13 (int a);
47 #pragma omp declare simd linear(a) linear(a:7) /* { dg-error "appears more than once" } */
48 int f14 (int a);
49 #pragma omp declare simd linear(a:6) linear(a:6)/* { dg-error "appears more than once" } */
50 int f15 (int a);
51 #pragma omp declare simd uniform(a) uniform(a) /* { dg-error "appears more than once" } */
52 int f16 (int a);
53 #pragma omp declare simd uniform(a) aligned (a: 32)
54 int f17 (int *a);