This patch tests if SVE object types if applied to linear clause is diagnosed
as expected.
gcc/testsuite/ChangeLog
* gcc.target/aarch64/sve/omp/linear.c: New test.
---
.../gcc.target/aarch64/sve/omp/linear.c | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/omp/linear.c
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/omp/linear.c
b/gcc/testsuite/gcc.target/aarch64/sve/omp/linear.c
new file mode 100644
index 00000000000..77b823a73d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/omp/linear.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-msve-vector-bits=256 -std=gnu99 -fopenmp -O2
-fdump-tree-ompexp" } */
+
+#include <arm_sve.h>
+
+int a[256];
+
+__attribute__((noinline, noclone)) int
+f1 (svint32_t va, int i)
+{
+ #pragma omp parallel for linear (va: 8) linear (i: 4) /* { dg-error {linear
clause applied to non-integral non-pointer variable with type 'svint32_t'} } */
+ for (int j = 16; j < 64; j++)
+ {
+ a[i] = j;
+ i += 4;
+ va = svindex_s32 (0,1);
+ }
+ return i;
+}
+
+__attribute__((noinline, noclone)) int
+f2 (svbool_t p, int i)
+{
+ #pragma omp parallel for linear (p: 0) linear (i: 4) /* { dg-error {linear
clause applied to non-integral non-pointer variable with type 'svbool_t'} } */
+ for (int j = 16; j < 64; j++)
+ {
+ a[i] = j;
+ i += 4;
+ p = svptrue_b32 ();
+ }
+ return i;
+}
+
--
2.25.1