summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/asm-goto.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/asm-goto.c')
-rw-r--r--clang/test/CodeGen/asm-goto.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGen/asm-goto.c b/clang/test/CodeGen/asm-goto.c
new file mode 100644
index 00000000000..2c4a1a0c4df
--- /dev/null
+++ b/clang/test/CodeGen/asm-goto.c
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -O0 -emit-llvm %s -o - | FileCheck %s
+
+int foo(int cond)
+{
+ // CHECK: callbr void asm sideeffect
+ // CHECK: to label %asm.fallthrough [label %label_true, label %loop], !srcloc !2
+ // CHECK: asm.fallthrough:
+ asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
+ asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
+ // CHECK: callbr void asm sideeffect
+ // CHECK: to label %asm.fallthrough1 [label %label_true, label %loop], !srcloc !3
+ // CHECK: asm.fallthrough1:
+ return 0;
+loop:
+ return 0;
+label_true:
+ return 1;
+}
OpenPOWER on IntegriCloud