aboutsummaryrefslogtreecommitdiffstats
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-09-29 19:39:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-09-29 19:39:13 +0000
commit2f0843321016091dca890c819741e06f11ceb390 (patch)
tree14a58a12ec364b18d20dd87291c8b83a999aedb3 /test/Instrumentation
parent67a25537491bb6f9eadf4016e10bbc9504b6b75d (diff)
downloadexternal_llvm-2f0843321016091dca890c819741e06f11ceb390.zip
external_llvm-2f0843321016091dca890c819741e06f11ceb390.tar.gz
external_llvm-2f0843321016091dca890c819741e06f11ceb390.tar.bz2
ObjectSizeOffsetEvaluator: Don't run into infinite recursion if we have a cyclic GEP.
Those can occur in dead code. PR17402. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/BoundsChecking/simple.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Instrumentation/BoundsChecking/simple.ll b/test/Instrumentation/BoundsChecking/simple.ll
index 16870c7..72b58f4 100644
--- a/test/Instrumentation/BoundsChecking/simple.ll
+++ b/test/Instrumentation/BoundsChecking/simple.ll
@@ -126,3 +126,20 @@ define i64 @f12(i64 %x, i64 %y) nounwind {
%4 = load i64* %3, align 8
ret i64 %4
}
+
+; PR17402
+; CHECK-LABEL: @f13
+define void @f13() nounwind {
+entry:
+ br label %alive
+
+dead:
+ ; Self-refential GEPs can occur in dead code.
+ %incdec.ptr = getelementptr inbounds i32* %incdec.ptr, i64 1
+ ; CHECK: %incdec.ptr = getelementptr inbounds i32* %incdec.ptr
+ %l = load i32* %incdec.ptr
+ br label %alive
+
+alive:
+ ret void
+}