From c606c3ff911eddcbf8bab95e67c7d8c1f69a493e Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 20 Jul 2012 23:07:40 +0000 Subject: 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 --- test/Instrumentation/BoundsChecking/simple.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/Instrumentation') 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 +} -- cgit v1.1