summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/NaryReassociate/nary-add.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/NaryReassociate/nary-add.ll b/llvm/test/Transforms/NaryReassociate/nary-add.ll
index 39d7c59ef9d..b3093ff6ecd 100644
--- a/llvm/test/Transforms/NaryReassociate/nary-add.ll
+++ b/llvm/test/Transforms/NaryReassociate/nary-add.ll
@@ -196,3 +196,14 @@ define void @iterative(i32 %a, i32 %b, i32 %c) {
ret void
}
+
+define void @avoid_infinite_loop(i32 %a, i32 %b) {
+; CHECK-LABEL: @avoid_infinite_loop
+ %ab = add i32 %a, %b
+; CHECK-NEXT: %ab
+ %ab2 = add i32 %ab, %b
+; CHECK-NEXT: %ab2
+ call void @foo(i32 %ab2)
+; CHECK-NEXT: @foo(i32 %ab2)
+ ret void
+}
OpenPOWER on IntegriCloud