Skip to content

Commit 2b0fae8

Browse files
committedMay 5, 2017
[ArgPromotion] Add a testcase for PR32917
Differential Revision: https://reviews.llvm.org/D32882 llvm-svn: 302216
1 parent 51904ae commit 2b0fae8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; RUN: opt < %s -argpromotion -S | FileCheck %s
2+
; PR 32917
3+
4+
@b = common local_unnamed_addr global i32 0, align 4
5+
@a = common local_unnamed_addr global i32 0, align 4
6+
7+
define i32 @fn2() local_unnamed_addr {
8+
%1 = load i32, i32* @b, align 4
9+
%2 = sext i32 %1 to i64
10+
%3 = inttoptr i64 %2 to i32*
11+
call fastcc void @fn1(i32* %3)
12+
ret i32 undef
13+
}
14+
15+
define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr {
16+
%2 = getelementptr inbounds i32, i32* %0, i64 -1
17+
%3 = load i32, i32* %2, align 4
18+
store i32 %3, i32* @a, align 4
19+
ret void
20+
}
21+
22+
; CHECK: getelementptr {{.*}} -1
23+
; CHECK-NOT: getelementptr {{.*}} 4294967295

0 commit comments

Comments
 (0)
Please sign in to comment.