llvm.org GIT mirror llvm / ae5b79d
[ArgPromotion] Add a testcase for PR32917 Differential Revision: https://reviews.llvm.org/D32882 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302216 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 2 years ago
1 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -argpromotion -S | FileCheck %s
1 ; PR 32917
2
3 @b = common local_unnamed_addr global i32 0, align 4
4 @a = common local_unnamed_addr global i32 0, align 4
5
6 define i32 @fn2() local_unnamed_addr {
7 %1 = load i32, i32* @b, align 4
8 %2 = sext i32 %1 to i64
9 %3 = inttoptr i64 %2 to i32*
10 call fastcc void @fn1(i32* %3)
11 ret i32 undef
12 }
13
14 define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr {
15 %2 = getelementptr inbounds i32, i32* %0, i64 -1
16 %3 = load i32, i32* %2, align 4
17 store i32 %3, i32* @a, align 4
18 ret void
19 }
20
21 ; CHECK: getelementptr {{.*}} -1
22 ; CHECK-NOT: getelementptr {{.*}} 4294967295