[ShrinkWrapping] Add a test case for r247710.
authorQuentin Colombet <qcolombet@apple.com>
Tue, 15 Sep 2015 18:51:43 +0000 (18:51 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Tue, 15 Sep 2015 18:51:43 +0000 (18:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247713 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/x86-shrink-wrapping.ll

index 9cfbf772bb397a6d59c372783668b6bc084b033b..ae9816f2fdc912c684bad74fb6d5afa559bbfa7f 100644 (file)
@@ -667,3 +667,33 @@ for.body:                                         ; preds = %for.body, %entry
 if.end:
   ret void
 }
 if.end:
   ret void
 }
+
+; Another infinite loop test this time with a body bigger than just one block.
+; CHECK-LABEL: infiniteloop2
+; CHECK: retq
+define void @infiniteloop2() {
+entry:
+  br i1 undef, label %if.then, label %if.end
+
+if.then:
+  %ptr = alloca i32, i32 4
+  br label %for.body
+
+for.body:                                         ; preds = %for.body, %entry
+  %sum.03 = phi i32 [ 0, %if.then ], [ %add, %body1 ], [ 1, %body2]
+  %call = tail call i32 asm "movl $$1, $0", "=r,~{ebx}"()
+  %add = add nsw i32 %call, %sum.03
+  store i32 %add, i32* %ptr
+  br i1 undef, label %body1, label %body2
+
+body1:
+  tail call void asm sideeffect "nop", "~{ebx}"()
+  br label %for.body
+
+body2:
+  tail call void asm sideeffect "nop", "~{ebx}"()
+  br label %for.body
+
+if.end:
+  ret void
+}