summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cilk-plus/for3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cilk-plus/for3.C')
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/for3.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cilk-plus/for3.C b/gcc/testsuite/g++.dg/cilk-plus/for3.C
new file mode 100644
index 0000000000..28dbdee433
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/for3.C
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcilkplus" } */
+
+// Test storage classes in the initialization of a <#pragma simd> for
+// loop.
+
+int *a, *b;
+
+void foo()
+{
+#pragma simd
+ for (int tt=5; tt < 10; ++tt)
+ {
+ a[tt] = b[tt];
+ if (tt == 8)
+ throw 1; /* { dg-error "throw expressions are not allowed" } */
+ }
+}