[x32] Fix FrameIndex check in SelectLEA64_32Addr
[oota-llvm.git] / test / CodeGen / X86 / 2008-01-08-SchedulerCrash.ll
index f31a38e28b35e2a29e2dd8953978e943e4683fb4..9b9b781cfa2e3571829360f700f368c58c265520 100644 (file)
@@ -1,19 +1,27 @@
-; RUN: llvm-as < %s | llc -march=x86
+; RUN: llc < %s -march=x86 -mattr=+cmov | FileCheck %s
+;
+; Test scheduling a multi-use compare. We should neither spill flags
+; nor clone the compare.
+; CHECK: cmp
+; CHECK-NOT: pushf
+; CHECK: cmov
+; CHECK-NOT: cmp
+; CHECK: cmov
 
        %struct.indexentry = type { i32, i8*, i8*, i8*, i8*, i8* }
 
-define i32 @_bfd_stab_section_find_nearest_line(i32 %offset) nounwind  {
+define i32 @_bfd_stab_section_find_nearest_line(i32 %offset, i1 %cond) nounwind  {
 entry:
        %tmp910 = add i32 0, %offset            ; <i32> [#uses=1]
-       br i1 true, label %bb951, label %bb917
+       br i1 %cond, label %bb951, label %bb917
 
 bb917:         ; preds = %entry
        ret i32 0
 
 bb951:         ; preds = %bb986, %entry
-       %tmp955 = sdiv i32 0, 2         ; <i32> [#uses=3]
+       %tmp955 = sdiv i32 %offset, 2           ; <i32> [#uses=3]
        %tmp961 = getelementptr %struct.indexentry* null, i32 %tmp955, i32 0            ; <i32*> [#uses=1]
-       br i1 true, label %bb986, label %bb967
+       br i1 %cond, label %bb986, label %bb967
 
 bb967:         ; preds = %bb951
        ret i32 0