aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c b/gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c
new file mode 100644
index 000000000..4532bf196
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/asmgoto-4.c
@@ -0,0 +1,44 @@
+/* PR middle-end/44071 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static inline int
+f1 (void)
+{
+ asm goto ("" : : : : l1, l2);
+ __builtin_unreachable ();
+ l1:
+ return 1;
+ l2:
+ return 0;
+}
+
+int
+b1 (int x)
+{
+ if (f1 () || x == 6)
+ x = 1;
+ else
+ x = 2;
+ return x;
+}
+
+static inline int
+f2 (void)
+{
+ asm goto ("" : : : : l1, l2);
+ l1:
+ return 1;
+ l2:
+ return 0;
+}
+
+int
+b2 (int x)
+{
+ if (f2 () || x == 6)
+ x = 1;
+ else
+ x = 2;
+ return x;
+}