summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/cmp.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/cmp.ll')
-rw-r--r--llvm/test/CodeGen/X86/cmp.ll44
1 files changed, 44 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/cmp.ll b/llvm/test/CodeGen/X86/cmp.ll
index 584179aacbc..eb9a2901142 100644
--- a/llvm/test/CodeGen/X86/cmp.ll
+++ b/llvm/test/CodeGen/X86/cmp.ll
@@ -211,3 +211,47 @@ define zeroext i1 @test15(i32 %bf.load, i32 %n) {
; CHECK: shrl $16, %edi
; CHECK: cmpl %esi, %edi
}
+
+define i8 @test16(i16 signext %L) {
+ %lshr = lshr i16 %L, 15
+ %trunc = trunc i16 %lshr to i8
+ %not = xor i8 %trunc, 1
+ ret i8 %not
+
+; CHECK-LABEL: test16:
+; CHECK: testw %di, %di
+; CHECK: setns %al
+}
+
+define i8 @test17(i32 %L) {
+ %lshr = lshr i32 %L, 31
+ %trunc = trunc i32 %lshr to i8
+ %not = xor i8 %trunc, 1
+ ret i8 %not
+
+; CHECK-LABEL: test17:
+; CHECK: testl %edi, %edi
+; CHECK: setns %al
+}
+
+define i8 @test18(i64 %L) {
+ %lshr = lshr i64 %L, 63
+ %trunc = trunc i64 %lshr to i8
+ %not = xor i8 %trunc, 1
+ ret i8 %not
+
+; CHECK-LABEL: test18:
+; CHECK: testq %rdi, %rdi
+; CHECK: setns %al
+}
+
+define zeroext i1 @test19(i32 %L) {
+ %lshr = lshr i32 %L, 31
+ %trunc = trunc i32 %lshr to i1
+ %not = xor i1 %trunc, 1
+ ret i1 %not
+
+; CHECK-LABEL: test19:
+; CHECK: testl %edi, %edi
+; CHECK: setns %al
+}
OpenPOWER on IntegriCloud