summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/inline-asm-flag-clobber.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/inline-asm-flag-clobber.ll')
-rw-r--r--test/CodeGen/X86/inline-asm-flag-clobber.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/X86/inline-asm-flag-clobber.ll b/test/CodeGen/X86/inline-asm-flag-clobber.ll
new file mode 100644
index 000000000000..3c536b716f62
--- /dev/null
+++ b/test/CodeGen/X86/inline-asm-flag-clobber.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | %prcontext test 1 | grep j
+; PR3701
+
+define i64 @t(i64* %arg) nounwind {
+ br i1 true, label %1, label %5
+
+; <label>:1 ; preds = %0
+ %2 = icmp eq i64* null, %arg ; <i1> [#uses=1]
+ %3 = tail call i64* asm sideeffect "movl %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"() nounwind ; <%struct.thread*> [#uses=0]
+ br i1 %2, label %4, label %5
+
+; <label>:4 ; preds = %1
+ ret i64 1
+
+; <label>:5 ; preds = %1
+ ret i64 0
+}