summaryrefslogtreecommitdiffstats
path: root/test/Transforms/ArgumentPromotion
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/ArgumentPromotion')
-rw-r--r--test/Transforms/ArgumentPromotion/basictest.ll2
-rw-r--r--test/Transforms/ArgumentPromotion/crash.ll21
2 files changed, 22 insertions, 1 deletions
diff --git a/test/Transforms/ArgumentPromotion/basictest.ll b/test/Transforms/ArgumentPromotion/basictest.ll
index ac9d7bf..d3d21fc 100644
--- a/test/Transforms/ArgumentPromotion/basictest.ll
+++ b/test/Transforms/ArgumentPromotion/basictest.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -argpromotion -mem2reg -S | not grep alloca
+; RUN: opt < %s -basicaa -argpromotion -mem2reg -S | not grep alloca
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
define internal i32 @test(i32* %X, i32* %Y) {
%A = load i32* %X ; <i32> [#uses=1]
diff --git a/test/Transforms/ArgumentPromotion/crash.ll b/test/Transforms/ArgumentPromotion/crash.ll
index e2d3d4d..fed002a 100644
--- a/test/Transforms/ArgumentPromotion/crash.ll
+++ b/test/Transforms/ArgumentPromotion/crash.ll
@@ -36,3 +36,24 @@ entry:
ret i1 undef
}
+
+; PR8932 - infinite promotion.
+%0 = type { %0* }
+
+define i32 @test2(i32 %a) {
+init:
+ %0 = alloca %0
+ %1 = alloca %0
+ %2 = call i32 @"clay_assign(Chain, Chain)"(%0* %0, %0* %1)
+ ret i32 0
+}
+
+define internal i32 @"clay_assign(Chain, Chain)"(%0* %c, %0* %d) {
+init:
+ %0 = getelementptr %0* %d, i32 0, i32 0
+ %1 = load %0** %0
+ %2 = getelementptr %0* %c, i32 0, i32 0
+ %3 = load %0** %2
+ %4 = call i32 @"clay_assign(Chain, Chain)"(%0* %3, %0* %1)
+ ret i32 0
+}
OpenPOWER on IntegriCloud