aboutsummaryrefslogtreecommitdiffstats
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-07-20 23:07:40 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-07-20 23:07:40 +0000
commitc606c3ff911eddcbf8bab95e67c7d8c1f69a493e (patch)
tree419225500a5672a9cb93e01358f2de62a7e5a6f3 /test/Instrumentation
parent78435f6bb7574d3d26f8c5151e2c140c525b7994 (diff)
downloadexternal_llvm-c606c3ff911eddcbf8bab95e67c7d8c1f69a493e.zip
external_llvm-c606c3ff911eddcbf8bab95e67c7d8c1f69a493e.tar.gz
external_llvm-c606c3ff911eddcbf8bab95e67c7d8c1f69a493e.tar.bz2
baby steps toward fixing some problems with inbound GEPs that overflow, as discussed 2 months ago or so.
Make sure we do not emit index computations with NSW flags so that we dont get an undef value if the GEP overflows git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/BoundsChecking/simple.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Instrumentation/BoundsChecking/simple.ll b/test/Instrumentation/BoundsChecking/simple.ll
index 3d532c3..16870c7 100644
--- a/test/Instrumentation/BoundsChecking/simple.ll
+++ b/test/Instrumentation/BoundsChecking/simple.ll
@@ -116,3 +116,13 @@ define void @f11(i128* byval %x) nounwind {
%3 = load i8* %2, align 4
ret void
}
+
+; CHECK: @f12
+define i64 @f12(i64 %x, i64 %y) nounwind {
+ %1 = tail call i8* @calloc(i64 1, i64 %x)
+; CHECK: mul i64 %y, 8
+ %2 = bitcast i8* %1 to i64*
+ %3 = getelementptr inbounds i64* %2, i64 %y
+ %4 = load i64* %3, align 8
+ ret i64 %4
+}