Fixed some bugs in register stack pass.
[llvm/zpu.git] / test / CodeGen / X86 / fp-elim.ll
blob60892a2352fb8b923cfbe301af995c4cf2811ff6
1 ; RUN: llc < %s -march=x86 -asm-verbose=false                           | FileCheck %s -check-prefix=FP-ELIM
2 ; RUN: llc < %s -march=x86 -asm-verbose=false -disable-fp-elim          | FileCheck %s -check-prefix=NO-ELIM
3 ; RUN: llc < %s -march=x86 -asm-verbose=false -disable-non-leaf-fp-elim | FileCheck %s -check-prefix=NON-LEAF
5 ; Implement -momit-leaf-frame-pointer
6 ; rdar://7886181
8 define i32 @t1() nounwind readnone {
9 entry:
10 ; FP-ELIM:      t1:
11 ; FP-ELIM-NEXT: movl
12 ; FP-ELIM-NEXT: ret
14 ; NO-ELIM:      t1:
15 ; NO-ELIM-NEXT: pushl %ebp
16 ; NO-ELIM:      popl %ebp
17 ; NO-ELIM-NEXT: ret
19 ; NON-LEAF:      t1:
20 ; NON-LEAF-NEXT: movl
21 ; NON-LEAF-NEXT: ret
22   ret i32 10
25 define void @t2() nounwind {
26 entry:
27 ; FP-ELIM:     t2:
28 ; FP-ELIM-NOT: pushl %ebp
29 ; FP-ELIM:     ret
31 ; NO-ELIM:      t2:
32 ; NO-ELIM-NEXT: pushl %ebp
33 ; NO-ELIM:      popl %ebp
34 ; NO-ELIM-NEXT: ret
36 ; NON-LEAF:      t2:
37 ; NON-LEAF-NEXT: pushl %ebp
38 ; NON-LEAF:      popl %ebp
39 ; NON-LEAF-NEXT: ret
40   tail call void @foo(i32 0) nounwind
41   ret void
44 declare void @foo(i32)