summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-06-23 18:42:15 +0000
committerSanjay Patel <spatel@rotateright.com>2017-06-23 18:42:15 +0000
commit243c5c12f5b579a3d316dadffe0d238aa8f8f658 (patch)
treee23ff533149bfc497a9eba624da86f986cb5b5c8 /test
parent34c8eeb7921900c4edbca9e3b67d63b8a9199299 (diff)
[x86] fix value types for SBB transform (PR33560)
I'm not sure yet why this wouldn't fail in the simple case, but clearly I used the wrong value type with: https://reviews.llvm.org/rL306040 ...and the bug manifests with: https://bugs.llvm.org/show_bug.cgi?id=33560 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/sbb.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/X86/sbb.ll b/test/CodeGen/X86/sbb.ll
index 409af00d3b2..bc00fc7c66a 100644
--- a/test/CodeGen/X86/sbb.ll
+++ b/test/CodeGen/X86/sbb.ll
@@ -111,3 +111,28 @@ define i8 @i8_select_neg1_or_0_commuted_as_math(i8 %x) {
ret i8 %add
}
+; Make sure we're creating nodes with the right value types. This would crash.
+; https://bugs.llvm.org/show_bug.cgi?id=33560
+
+define void @PR33560(i8 %x, i64 %y) {
+; CHECK-LABEL: PR33560:
+; CHECK: # BB#0: # %entry
+; CHECK-NEXT: negb %dil
+; CHECK-NEXT: sbbq %rax, %rax
+; CHECK-NEXT: cmpq %rsi, %rax
+; CHECK-NEXT: retq
+entry:
+ %cmp1 = icmp eq i8 %x, 0
+ %ext = zext i1 %cmp1 to i64
+ %add = add i64 %ext, -1
+ %cmp2 = icmp eq i64 %add, %y
+ br i1 %cmp2, label %end, label %else
+
+else:
+ %tmp7 = zext i1 %cmp1 to i8
+ br label %end
+
+end:
+ ret void
+}
+