summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c')
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
new file mode 100644
index 00000000000..b5e37ced12d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus -w" } */
+
+/* We use -w because in the first error, there will be a warning of setting an
+ integer to a pointer. Just ignore it to expose the rank mismatch error. */
+
+int main (void)
+{
+ int x = 0;
+ int array[10][10], array2[10];
+
+ array[:][:] = array[:]; /* { dg-error "rank mismatch between" } */
+
+ x = array2[:]; /* { dg-error "cannot be scalar when" } */
+
+ return 0;
+}