From caca2b659f2ffc56fbc468336fa8e27eb042f48f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 24 Jul 2009 22:42:45 +0000 Subject: [PATCH] Forgot this test earlier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77007 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/2009-07-22-LinearScanBug.ll | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/CodeGen/X86/2009-07-22-LinearScanBug.ll diff --git a/test/CodeGen/X86/2009-07-22-LinearScanBug.ll b/test/CodeGen/X86/2009-07-22-LinearScanBug.ll new file mode 100644 index 00000000000..bfb76fe8f51 --- /dev/null +++ b/test/CodeGen/X86/2009-07-22-LinearScanBug.ll @@ -0,0 +1,29 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-pc-mingw32 +; PR4572 + + %"struct.std::valarray" = type { i32, i32* } + +define void @_ZSt17__gslice_to_indexjRKSt8valarrayIjES2_RS0_(i32 %__o, %"struct.std::valarray"* nocapture %__l, %"struct.std::valarray"* nocapture %__s, %"struct.std::valarray"* nocapture %__i) nounwind { +entry: + %0 = alloca i32, i32 undef, align 4 ; [#uses=1] + br i1 undef, label %return, label %bb4 + +bb4: ; preds = %bb7.backedge, %entry + %indvar = phi i32 [ %indvar.next, %bb7.backedge ], [ 0, %entry ] ; [#uses=2] + %scevgep24.sum = sub i32 undef, %indvar ; [#uses=2] + %scevgep25 = getelementptr i32* %0, i32 %scevgep24.sum ; [#uses=1] + %scevgep27 = getelementptr i32* undef, i32 %scevgep24.sum ; [#uses=1] + %1 = load i32* %scevgep27, align 4 ; [#uses=0] + br i1 undef, label %bb7.backedge, label %bb5 + +bb5: ; preds = %bb4 + store i32 0, i32* %scevgep25, align 4 + br label %bb7.backedge + +bb7.backedge: ; preds = %bb5, %bb4 + %indvar.next = add i32 %indvar, 1 ; [#uses=1] + br label %bb4 + +return: ; preds = %entry + ret void +}