summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/target-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/target-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/target-1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/target-1.c b/gcc/testsuite/gcc.dg/gomp/target-1.c
new file mode 100644
index 00000000000..09e65bd3115
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/target-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ bad1:
+ #pragma omp target
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp target
+ {
+ bad2: ;
+ }
+
+ #pragma omp target
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp target
+ { case 0:; }
+ }
+}