summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2012-09-28 20:26:33 +0000
committerManman Ren <mren@apple.com>2012-09-28 20:26:33 +0000
commit009cd82c59a332b4943d52307f455d1975928e23 (patch)
treef52f5f23ba9664467648ed1aa534036c7176e1a7 /llvm/test
parent80ac9efec467cdad333d47e587921bbfd412ca35 (diff)
downloadbcm5719-llvm-009cd82c59a332b4943d52307f455d1975928e23.tar.gz
bcm5719-llvm-009cd82c59a332b4943d52307f455d1975928e23.zip
Testcase for r164835
llvm-svn: 164842
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/jump_sign.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/jump_sign.ll b/llvm/test/CodeGen/X86/jump_sign.ll
index 0cf397d4af0..78d9e06f594 100644
--- a/llvm/test/CodeGen/X86/jump_sign.ll
+++ b/llvm/test/CodeGen/X86/jump_sign.ll
@@ -278,3 +278,31 @@ entry:
%cond = select i1 %cmp, i32 %add, i32 0
ret i32 %cond
}
+
+; PR13966
+@b = common global i32 0, align 4
+@a = common global i32 0, align 4
+define i32 @test1(i32 %p1) nounwind uwtable {
+entry:
+; CHECK: test1:
+; CHECK: testb
+; CHECK: j
+; CHECK: ret
+ %0 = load i32* @b, align 4
+ %cmp = icmp ult i32 %0, %p1
+ %conv = zext i1 %cmp to i32
+ %1 = load i32* @a, align 4
+ %and = and i32 %conv, %1
+ %conv1 = trunc i32 %and to i8
+ %2 = urem i8 %conv1, 3
+ %tobool = icmp eq i8 %2, 0
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then:
+ %dec = add nsw i32 %1, -1
+ store i32 %dec, i32* @a, align 4
+ br label %if.end
+
+if.end:
+ ret i32 undef
+}
OpenPOWER on IntegriCloud