Skip to content

Commit 1e25b67

Browse files
committed
[X86] Add test coverage for #142513
1 parent feb21e2 commit 1e25b67

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

llvm/test/CodeGen/X86/pr142513.ll

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefixes=X86
3+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=X64
4+
5+
define i64 @foo(i64 %x) {
6+
; X86-LABEL: foo:
7+
; X86: # %bb.0: # %entry
8+
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
9+
; X86-NEXT: shrl $15, %eax
10+
; X86-NEXT: cmpl $65509, %eax # imm = 0xFFE5
11+
; X86-NEXT: je .LBB0_1
12+
; X86-NEXT: # %bb.2: # %if.end
13+
; X86-NEXT: movl $3, %eax
14+
; X86-NEXT: movl $2146598912, %edx # imm = 0x7FF28000
15+
; X86-NEXT: retl
16+
; X86-NEXT: .LBB0_1: # %if.then
17+
;
18+
; X64-LABEL: foo:
19+
; X64: # %bb.0: # %entry
20+
; X64-NEXT: shrq $47, %rdi
21+
; X64-NEXT: cmpl $65509, %edi # imm = 0xFFE5
22+
; X64-NEXT: je .LBB0_1
23+
; X64-NEXT: # %bb.2: # %if.end
24+
; X64-NEXT: movabsq $9219572124669181952, %rax # imm = 0x7FF2800000000000
25+
; X64-NEXT: addq $3, %rax
26+
; X64-NEXT: retq
27+
; X64-NEXT: .LBB0_1: # %if.then
28+
entry:
29+
%shr.mask = and i64 %x, -140737488355328
30+
%cmp = icmp eq i64 %shr.mask, 9219572124669181952
31+
br i1 %cmp, label %if.then, label %if.end
32+
33+
if.then:
34+
unreachable
35+
36+
if.end:
37+
ret i64 9219572124669181955
38+
}

0 commit comments

Comments
 (0)