[llvm] r302216 - [ArgPromotion] Add a testcase for PR32917
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Fri May 5 01:40:24 PDT 2017
Author: mstorsjo
Date: Fri May 5 03:40:24 2017
New Revision: 302216
URL: http://llvm.org/viewvc/llvm-project?rev=302216&view=rev
Log:
[ArgPromotion] Add a testcase for PR32917
Differential Revision: https://reviews.llvm.org/D32882
Added:
llvm/trunk/test/Transforms/ArgumentPromotion/pr32917.ll
Added: llvm/trunk/test/Transforms/ArgumentPromotion/pr32917.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ArgumentPromotion/pr32917.ll?rev=302216&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/ArgumentPromotion/pr32917.ll (added)
+++ llvm/trunk/test/Transforms/ArgumentPromotion/pr32917.ll Fri May 5 03:40:24 2017
@@ -0,0 +1,23 @@
+; RUN: opt < %s -argpromotion -S | FileCheck %s
+; PR 32917
+
+ at b = common local_unnamed_addr global i32 0, align 4
+ at 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
More information about the llvm-commits
mailing list