aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyCFG
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-07-14 00:45:38 +0000
committerDale Johannesen <dalej@apple.com>2009-07-14 00:45:38 +0000
commit4458ab0d83c33a649c61355a4d80e94014193856 (patch)
treee0a43bf94fd3e8633ca24eb61cc7e77289180c5d /test/Transforms/SimplifyCFG
parentd9ef1a860e01321cacbd57b6f7c154f399c813d4 (diff)
downloadexternal_llvm-4458ab0d83c33a649c61355a4d80e94014193856.zip
external_llvm-4458ab0d83c33a649c61355a4d80e94014193856.tar.gz
external_llvm-4458ab0d83c33a649c61355a4d80e94014193856.tar.bz2
Don't delete asm's just because their inputs are undefined;
xor R, R is a common and valid idiom for zeroing a register, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyCFG')
-rw-r--r--test/Transforms/SimplifyCFG/2009-07-13-no-delete-asm.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/2009-07-13-no-delete-asm.ll b/test/Transforms/SimplifyCFG/2009-07-13-no-delete-asm.ll
new file mode 100644
index 0000000..4664ee0
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/2009-07-13-no-delete-asm.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep xor
+; ModuleID = '<stdin>'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i386-apple-darwin9.6"
+
+define void @bar() nounwind {
+entry:
+ store i16 undef, i16* null
+ %asmtmp = call i32 asm sideeffect "xor $0, $0", "=={bx},rm,~{dirflag},~{fpsr},~{flags},~{memory}"(i16 undef) nounwind ; <i32> [#uses=0]
+ ret void
+}