diff options
author | Martin Storsjo <martin@martin.st> | 2017-05-05 08:40:24 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-05-05 08:40:24 +0000 |
commit | 2b0fae877eed1887d3500223c0ae59fc0e0ed654 (patch) | |
tree | 7910f9270145eb3bc68d47af45569dac99d7738a | |
parent | 51904ae35aada8243afe53ac58e14fc8788661ee (diff) | |
download | bcm5719-llvm-2b0fae877eed1887d3500223c0ae59fc0e0ed654.tar.gz bcm5719-llvm-2b0fae877eed1887d3500223c0ae59fc0e0ed654.zip |
[ArgPromotion] Add a testcase for PR32917
Differential Revision: https://reviews.llvm.org/D32882
llvm-svn: 302216
-rw-r--r-- | llvm/test/Transforms/ArgumentPromotion/pr32917.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ArgumentPromotion/pr32917.ll b/llvm/test/Transforms/ArgumentPromotion/pr32917.ll new file mode 100644 index 00000000000..a2aeac081ce --- /dev/null +++ b/llvm/test/Transforms/ArgumentPromotion/pr32917.ll @@ -0,0 +1,23 @@ +; RUN: opt < %s -argpromotion -S | FileCheck %s +; PR 32917 + +@b = common local_unnamed_addr global i32 0, align 4 +@a = common local_unnamed_addr global i32 0, align 4 + +define i32 @fn2() local_unnamed_addr { + %1 = load i32, i32* @b, align 4 + %2 = sext i32 %1 to i64 + %3 = inttoptr i64 %2 to i32* + call fastcc void @fn1(i32* %3) + ret i32 undef +} + +define internal fastcc void @fn1(i32* nocapture readonly) unnamed_addr { + %2 = getelementptr inbounds i32, i32* %0, i64 -1 + %3 = load i32, i32* %2, align 4 + store i32 %3, i32* @a, align 4 + ret void +} + +; CHECK: getelementptr {{.*}} -1 +; CHECK-NOT: getelementptr {{.*}} 4294967295 |