diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 19:06:08 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 19:06:08 +0000 |
commit | 23871d0cedfe77078bb09c3be41afd26e4a9f551 (patch) | |
tree | b855c0f5f2b49779d10067e2ee590fb7d92a9ef8 /gcc/testsuite/c-c++-common/gomp | |
parent | 2b2b90a31143f386260cc41a9aeb05f6516c9538 (diff) | |
download | ppe42-gcc-23871d0cedfe77078bb09c3be41afd26e4a9f551.tar.gz ppe42-gcc-23871d0cedfe77078bb09c3be41afd26e4a9f551.zip |
* c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array.
* semantics.c (finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array nor reference to those.
* g++.dg/gomp/simd-1.C: New test.
* g++.dg/gomp/declare-simd-1.C (f32): Fix up aligned clause argument.
* g++.dg/gomp/declare-simd-2.C (fn13, fn14): Add new tests.
* gcc.dg/gomp/declare-simd-2.c (fn7, fn8, fn9, fn10, fn11): Likewise.
* c-c++-common/gomp/simd6.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204273 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common/gomp')
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/simd6.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/gomp/simd6.c b/gcc/testsuite/c-c++-common/gomp/simd6.c new file mode 100644 index 00000000000..3a90c225e9e --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/simd6.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +extern int a[1024]; + +struct S { int i; } s; + +void +f1 (int x, float f, int *p) +{ + int i; + #pragma omp simd aligned(x : 32) /* { dg-error "neither a pointer nor an array" } */ + for (i = 0; i < 1024; i++) + a[i]++; + #pragma omp simd aligned(f) /* { dg-error "neither a pointer nor an array" } */ + for (i = 0; i < 1024; i++) + a[i]++; + #pragma omp simd aligned(s : 16) /* { dg-error "neither a pointer nor an array" } */ + for (i = 0; i < 1024; i++) + a[i]++; + #pragma omp simd aligned(a : 8) + for (i = 0; i < 1024; i++) + a[i]++; + #pragma omp simd aligned(p : 8) + for (i = 0; i < 1024; i++) + a[i]++; +} |