mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-08 13:00:43 +00:00
3ffda498ec
The second operand of an "ri" instruction may be an immediate, but it may also be a globalvariable, so we should make any assumptions. This fixes PR31271. Differential Revision: https://reviews.llvm.org/D27481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288964 91177308-0d34-0410-b5e6-96231b3b80d8
21 lines
445 B
LLVM
21 lines
445 B
LLVM
; RUN: llc -mtriple=i386-unknown-linux-gnu < %s | FileCheck %s
|
|
|
|
@c = external global [1 x i32], align 4
|
|
|
|
; CHECK-LABEL: fn1
|
|
; CHECK: leal c(%eax), %ecx
|
|
define void @fn1(i32 %k) {
|
|
%g = getelementptr inbounds [1 x i32], [1 x i32]* @c, i32 0, i32 %k
|
|
%cmp = icmp ne i32* undef, %g
|
|
%z = zext i1 %cmp to i32
|
|
store i32 %z, i32* undef, align 4
|
|
%cmp2 = icmp eq i32* %g, null
|
|
br i1 %cmp2, label %u, label %r
|
|
|
|
u:
|
|
unreachable
|
|
|
|
r:
|
|
ret void
|
|
}
|