diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-07 05:03:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-07 05:03:34 +0000 |
commit | 62ce3b31a782a6c8fbb816c75365abfacc820bb6 (patch) | |
tree | 08d68369c816ae8d0532e64fbb26b7a89925a603 /test/Transforms/InstCombine | |
parent | ae7dd8004eb286039ee1eb1a35ddb1ff4eafe460 (diff) |
fix rdar://6762290, a crash compiling cxx filt with clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/2009-04-06-GEP-Index-Crash.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2009-04-06-GEP-Index-Crash.ll b/test/Transforms/InstCombine/2009-04-06-GEP-Index-Crash.ll new file mode 100644 index 0000000000..49e1f0af67 --- /dev/null +++ b/test/Transforms/InstCombine/2009-04-06-GEP-Index-Crash.ll @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; rdar://6762290 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9" + %T = type <{ i64, i64, i64 }> + +define i32 @test(i8* %start, i32 %X) nounwind { +entry: + %tmp3 = load i64* null ; <i64> [#uses=1] + %add.ptr = getelementptr i8* %start, i64 %tmp3 ; <i8*> [#uses=1] + %tmp158 = load i32* null ; <i32> [#uses=1] + %add.ptr159 = getelementptr %T* null, i32 %tmp158 + %add.ptr209 = getelementptr i8* %start, i64 0 ; <i8*> [#uses=1] + %add.ptr212 = getelementptr i8* %add.ptr209, i32 %X ; <i8*> [#uses=1] + %cmp214 = icmp ugt i8* %add.ptr212, %add.ptr ; <i1> [#uses=1] + br i1 %cmp214, label %if.then216, label %if.end363 + +if.then216: ; preds = %for.body162 + ret i32 1 + +if.end363: ; preds = %for.body162 + ret i32 0 +} |