Added support for Cilk Plus SIMD-enabled functions for C++.
[official-gcc.git] / gcc / testsuite / c-c++-common / cilk-plus / SE / vlength_errors.c
blob1bcf2a27ab90fb8e4f8870536046a63748a7bd5e
1 /* { dg-do compile } */
2 /* { dg-options "-fcilkplus -Wunknown-pragmas" } */
4 #define Q 4
6 int z = Q;
8 __attribute__ ((vector (uniform(x), vectorlength (), linear (y:1) ))) /* { dg-error "expected expression" "" { target c } } */
9 /* { dg-error "expected primary-expression" "" { target c++ } 8 } */
10 int func2 (int x, int y)
12 int zq = 5;
13 return x + (y*zq);
16 __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (4.5) ))) /* { dg-error "vectorlength must be an integer" } */
17 int func3 (int x, int y)
19 int zq = 5;
20 return x + (y*zq);
23 __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (z) ))) /* { dg-error "vectorlength must be an integer" "" { target c } } */
24 /* { dg-error "constant" "" { target c++ } 23 } */
25 int func4 (int x, int y)
27 int zq = 5;
28 return x + (y*zq);
31 __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (Q) ))) /* This is OK! */
32 int func5 (int x, int y)
34 int zq = 5;
35 return x + (y*zq);
38 __attribute__ ((vector (uniform(x), vectorlength (z), linear (y:1)))) /* { dg-error "vectorlength must be an integer" "" { target c } } */
39 /* { dg-error "constant" "" { target c++ } 38 } */
40 int func6 (int x, int y)
42 int zq = 5;
43 return x + (y*zq);
46 __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (sizeof (int)) ))) /* This is OK too! */
47 int func7 (int x, int y)
49 int zq = 5;
50 return x + (y*zq);
53 int main (void)
55 int ii = 0, q = 5;
56 for (ii = 0; ii < 10; ii++)
57 q += func2 (z, ii);
58 return q;