diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/cilk-plus/PS')
18 files changed, 0 insertions, 616 deletions
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c deleted file mode 100644 index d391d7b1eed..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c +++ /dev/null @@ -1,41 +0,0 @@ -/* PR c/70436 */ -/* { dg-do compile } */ -/* { dg-options "-fcilkplus -Wparentheses" } */ - -int a, b, c; -void bar (void); -void baz (void); - -void -f1 (void) -{ - int i; - - if (a) /* { dg-warning "ambiguous" } */ - #pragma simd - for (i = 0; i < 10; i++) - if (b) - bar (); - else - baz (); - - if (a) - #pragma simd - for (i = 0; i < 10; i++) - { - if (b) - bar (); - else - baz (); - } - - if (a) - #pragma simd - for (i = 0; i < 10; i++) - { - if (b) - bar (); - } - else - baz (); -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c deleted file mode 100644 index ed85a7a65eb..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-fcilkplus -fopenmp" } */ -/* { dg-require-effective-target fopenmp } */ - -int *a, *b, c; -void *jmpbuf[10]; - -void foo() -{ - int j; - -#pragma simd - for (int i=0; i < 1000; ++i) - { - if (c == 6) - __builtin_setjmp (jmpbuf); /* { dg-error "setjmp" } */ - a[i] = b[i]; - } - -#pragma simd - for (int i=0; i < 1000; ++i) - { - if (c==5) - break; /* { dg-error "break statement " } */ - } - -#pragma simd - for (int i=0; i < 1000; ++i) - { -#pragma omp for /* { dg-error "OpenMP constructs other than" } */ - for (j=0; j < 1000; ++j) - a[i] = b[i]; - } -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c deleted file mode 100644 index 332e01cbdde..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c +++ /dev/null @@ -1,80 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -Werror -Wunknown-pragmas -fcilkplus" } */ - -volatile int *a, *b; - -void foo() -{ - int i, j, k; - -#pragma simd assert /* { dg-error "expected '#pragma simd' clause" } */ - for (i=0; i < 100; ++i) - a[i] = b[i]; - -#pragma simd vectorlength /* { dg-error "expected '\\('" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd vectorlength /* { dg-error "expected '\\('" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd vectorlength(sizeof (a) == sizeof (float) ? 4 : 8) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd vectorlength(4,8) /* { dg-error "expected '\\)'" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd vectorlength(i) /* { dg-error "\(vectorlength must be an integer\|in a constant\)" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(35) /* { dg-error "expected identifier" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(blah) /* { dg-error "'blah' \(undeclared\|has not been\)" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(j, 36, k) /* { dg-error "expected" } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(i, j) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(i) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(i : 4) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(i : 2, j : 4, k) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(j : sizeof (a) == sizeof (float) ? 4 : 8) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - - // And now everyone in unison! -#pragma simd linear(j : 4) vectorlength(4) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(blah2, 36) - /* { dg-error "'blah2' \(undeclared\|has not been\)" "undeclared" { target *-*-* } .-1 } */ - /* { dg-error "expected" "expected" { target *-*-* } .-2 } */ - for (int i=0; i < 1000; ++i) - a[i] = b[j]; - -#pragma simd linear(j : k) - for (int i=0; i < 1234; ++i) - a[i] = b[j]; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c deleted file mode 100644 index 0f7b5006254..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fdump-tree-original -fcilkplus" } */ - -volatile int *a, *b; - -void foo() -{ - int j, k; - -#pragma simd linear(j : 4, k) vectorlength(4) - for (int i=0; i < 1000; ++i) - a[i] = b[j]; -} - -/* { dg-final { scan-tree-dump-times "linear\\(j:4\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "linear\\(k:1\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "safelen\\(4\\)" 1 "original" } } */ diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c deleted file mode 100644 index 0b5ace6a1a0..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c +++ /dev/null @@ -1,39 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fcilkplus" } */ - -#define N 1000 - -int A[N], B[N], C[N]; -int main (void) -{ -#pragma simd private (B) linear(B:1) /* { dg-error "applied to non-integral" } */ - for (int ii = 0; ii < N; ii++) - { - A[ii] = B[ii] + C[ii]; - } - -#pragma simd private (B, C) linear(B:1) /* { dg-error "applied to non-integral" } */ - for (int ii = 0; ii < N; ii++) - { - A[ii] = B[ii] + C[ii]; - } - -#pragma simd private (B) linear(C:2, B:1) /* { dg-error "applied to non-integral" } */ - for (int ii = 0; ii < N; ii++) - { - A[ii] = B[ii] + C[ii]; - } - -#pragma simd reduction (+:B) linear(B:1) /* { dg-error "applied to non-integral" } */ - for (int ii = 0; ii < N; ii++) - { - A[ii] = B[ii] + C[ii]; - } - -#pragma simd reduction (+:B) linear(B) /* { dg-error "applied to non-integral" } */ - for (int ii = 0; ii < N; ii++) - { - A[ii] = B[ii] + C[ii]; - } - return 0; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c deleted file mode 100644 index 45dcb9f606a..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-fcilkplus" } */ - -#define N 1000 - -int B, C; -double D; - -int main (void) -{ - #pragma simd linear (D:10) - for (int ii = 0; ii < N; ii++) - ; - - #pragma simd private (B) linear(B:1) /* { dg-error "more than once" } */ - for (int ii = 0; ii < N; ii++) - ; - - #pragma simd private (B, C) linear(B:1) /* { dg-error "more than once" } */ - for (int ii = 0; ii < N; ii++) - ; - - #pragma simd private (B) linear(C:2, B:1) /* { dg-error "more than once" } */ - for (int ii = 0; ii < N; ii++) - ; - - #pragma simd reduction (+:B) linear(B:1) /* { dg-error "more than once" } */ - for (int ii = 0; ii < N; ii++) - ; - - #pragma simd reduction (+:B) linear(B) /* { dg-error "more than once" } */ - for (int ii = 0; ii < N; ii++) - ; - - return 0; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c deleted file mode 100644 index 3b678952c72..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c +++ /dev/null @@ -1,132 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fcilkplus" } */ - -int *a, *b, *c; -int something; - -void foo() -{ - int i, j; - - // Declaration and initialization is allowed. -#pragma simd - for (int i=0; i < 1000; i++) - a[i] = b[j]; - - // Empty initialization is not allowed. -#pragma simd - for (; i < 5; ++i) // { dg-error "expected iteration" } - a[i] = i; - - // Empty condition is not allowed. -#pragma simd - for (int i=0; ; ++i) /* { dg-error "missing controlling" } */ - a[i] = i; - - // Empty increment is not allowed. -#pragma simd - for (int i=0; i < 1234; ) /* { dg-error "missing increment" } */ - a[i] = i*2; - -#pragma simd - i = 5; /* { dg-error "for statement expected" } */ - - // Initialization variables must be either integral or pointer types. - struct S { - int i; - }; -#pragma simd - for (struct S ss = { 0 }; ss.i <= 1000; ++ss.i) /* { dg-error "invalid controlling\|invalid type for iteration\|invalid increment" } */ - a[ss.i] = b[ss.i]; - - #pragma simd - for (float f=0.0; f < 15.0; ++f) /* { dg-error "invalid type" } */ - a[(int)f] = (int) f; - - // Pointers are OK. - #pragma simd - for (int *i=c; i < &c[100]; ++i) - *a = '5'; - - // Condition of '==' is not allowed. -#pragma simd - for (int i=j; i == 5; ++i) /* { dg-error "invalid controlling predicate" } */ - a[i] = b[i]; - - // The LHS or RHS of the condition must be the initialization variable. -#pragma simd - for (int i=0; i+j < 1234; ++i) /* { dg-error "invalid controlling predicate" } */ - a[i] = b[i]; - - // Likewise. -#pragma simd - for (int i=0; 1234 < i + j; ++i) /* { dg-error "invalid controlling predicate" } */ - a[i] = b[i]; - - // Likewise, this is ok. -#pragma simd - for (int i=0; 1234 + j < i; ++i) - a[i] = b[i]; - - // According to the CilkPlus forum, casts are not allowed, even if - // they are no-ops. -#pragma simd - for (int i=0; (char)i < 1234; ++i) /* { dg-error "invalid controlling predicate" } */ - a[i] = b[i]; - -#pragma simd - for (int i=255; i != something; --i) - a[i] = b[i]; - -#pragma simd - for (int i=100; i != 5; i += something) - a[i] = b[i]; - - // Increment must be on the induction variable. -#pragma simd - for (int i=0; i < 100; j++) /* { dg-error "invalid increment expression" } */ - a[i] = b[i]; - - // Likewise. -#pragma simd - for (int i=0; i < 100; j = i + 1) /* { dg-error "invalid increment expression" } */ - a[i] = b[i]; - - // Likewise. -#pragma simd - for (int i=0; i < 100; i = j + 1) /* { dg-error "invalid increment expression" } */ - a[i] = b[i]; - -#pragma simd - for (int i=0; i < 100; i = i + 5) - a[i] = b[i]; - - // Only PLUS and MINUS increments are allowed. -#pragma simd - for (int i=0; i < 100; i *= 5) /* { dg-error "invalid increment expression" } */ - a[i] = b[i]; - -#pragma simd - for (int i=0; i < 100; i -= j) - a[i] = b[i]; - -#pragma simd - for (int i=0; i < 100; i = i + j) - a[i] = b[i]; - -#pragma simd - for (int i=0; i < 100; i = j + i) - a[i] = b[i]; - -#pragma simd - for (int i=0; i < 100; ++i, ++j) /* { dg-error "invalid increment expression" } */ - a[i] = b[i]; - -#pragma simd - for (int *point=0; point < b; ++point) - *point = 555; - -#pragma simd - for (int *point=0; point > b; --point) - *point = 555; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c deleted file mode 100644 index 86606275ac4..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c +++ /dev/null @@ -1,8 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fcilkplus" } */ - -#pragma simd /* { dg-error "must be inside a function" } */ - -void foo() -{ -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c deleted file mode 100644 index 2da8235f319..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fcilkplus" } */ - -int *a, *c; - -void foo() -{ - int i, j; - - // Pointers are OK. - #pragma simd - for (int *i=c; i < c; ++i) - *a = '5'; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c deleted file mode 100644 index 1d1bb048e49..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-fcilkplus" } */ - -double t1 (double *x, int N) -{ - double result = 0.0; - - #pragma simd reduction (max: result) - for (int i = 0; i < N; ++i) - result = x[i] > result ? x[i] : result; - - return result; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c deleted file mode 100644 index d8cec84f149..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O3 -fcilkplus" } */ - -/* FIXME: This test has been xfailed until reductions are fixed. */ - -int argc = 1; - -/* This is a simple vectorization test. It tests if reduction works - and if it can vectorize the loop in func correctly. */ -#define N 1000 - -int func (int *p, int *q) { - int x = 0; -#pragma simd reduction (+:x) - for (int ii = 0; ii < N; ii++) { - x += (q[ii] + p[ii]); - } - return x; - -} - -int main () -{ - int ii = 0, x; - int Array[N], Array2[N]; - - for (ii = 0; ii < N; ii++) - { - Array[ii] = 5 + argc; - Array2[ii] = argc; - } - x = func (Array, Array2); - - if (x != N * 7) - return 1; - return 0; -} - diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c deleted file mode 100644 index f5554f6b1ae..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O3 -fcilkplus" } */ - -/* FIXME: This test has been xfailed until reductions are fixed. */ - -#include <stdio.h> - -#define ARRAY_SIZE (256) -int a[ARRAY_SIZE]; - -__attribute__((noinline)) -int addit (int *arr, int N) -{ - int s=0; -#pragma simd reduction (+:s) - for (int i = 0; i < N; i++) - s += arr[i]; - return s; -} - -int main () { - int i, s = 0, r = 0; - for (i = 0; i < ARRAY_SIZE; i++) - { - a[i] = i; - } - - s = addit (a, ARRAY_SIZE); - - for (i = 0; i < ARRAY_SIZE; i++) - r += i; - - if (s == r) - return 0; - return 1; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c deleted file mode 100644 index 35cb904a540..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c +++ /dev/null @@ -1,41 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O3 -fcilkplus" } */ - -#define N 256 -#if HAVE_IO -#include <stdio.h> -#endif -#include <stdlib.h> - -int -reduction_simd (int *a) -{ - int s = 0; - -#pragma simd reduction (+:s) - for (int i = 0; i < N; i++) - { - s += a[i]; - } - - return s; -} - -int -main () -{ - int *a = (int *) malloc (N * sizeof (int)); - int i, s = (N - 1) * N / 2; - - for (i = 0; i < N; i++) - { - a[i] = i; - } -#if HAVE_IO - printf ("%d, %d\n", s, reduction_simd (a)); -#endif - if (s == reduction_simd (a)) - return 0; - else - return 1; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c deleted file mode 100644 index c8fe1c762bc..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c +++ /dev/null @@ -1,28 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-fcilkplus -O3" } */ - -#include <stdlib.h> - -#define N 4 - -float f1[] = { 2.0, 3.0, 4.0, 5.0 }; -float f2[] = { 1.0, 6.0, -1.0, -2.0 }; -float res[] = { 3.0, 9.0, 3.0, 3.0 }; - -__attribute__((noinline)) -void verify (float *sum) -{ - for (int i=0; i < N; ++i) - if (sum[i] != res[i]) - abort (); -} - -int main() -{ - float sum[N]; -#pragma simd - for (int i=0; i < N; ++i) - sum[i] = f1[i] + f2[i]; - verify (sum); - return 0; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c deleted file mode 100644 index 5af2909d2ec..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fdump-tree-gimple -fcilkplus" } */ - -int *a, *b; - -void foo() -{ -#pragma simd vectorlength(8) - for (int i=0; i < 1000; ++i) - a[i] = b[i]; -} - -/* { dg-final { scan-tree-dump-times "safelen\\(8\\)" 1 "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c deleted file mode 100644 index d90397717ac..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fcilkplus" } */ - -#define vl(n) vectorlength(2*n) -void -foo (int *a, int *b, int *c) -{ - int i; -#pragma simd vl(4) - for (i = 0; i < 64; i++) - a[i] = b[i] * c[i]; -} diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c deleted file mode 100644 index d219a85acd5..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fcilkplus -save-temps" } */ - -#define vl(n) vectorlength(2*n) -void -foo (int *a, int *b, int *c) -{ - int i; -#pragma simd vl(4) - for (i = 0; i < 64; i++) - a[i] = b[i] * c[i]; -} - diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c deleted file mode 100644 index 9aa4a68290d..00000000000 --- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c +++ /dev/null @@ -1,21 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3 -fcilkplus" } */ - -volatile int *a, *b, N; -typedef int tint; -struct someclass { - int a; - char b; - int *p; -}; - -void foo() -{ -#pragma simd vectorlength(4) vectorlength(8) /* { dg-error "too many 'vectorlength' clauses" } */ - for (int i=0; i < N; ++i) - a[i] = b[i]; - -#pragma simd vectorlength(3) /* { dg-error "must be a power of 2" } */ - for (int i=0; i < N; ++i) - a[i] = b[i]; -} |