[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / llvm / test / CodeGen / X86 / fp-elim.ll
blob1b2fc07bbc383a360434e37910f5eff751393716
1 ; RUN: llc < %s -mtriple=i686-- -asm-verbose=false                           | FileCheck %s --check-prefix=FP-ELIM
2 ; RUN: llc < %s -mtriple=i686-- -asm-verbose=false -frame-pointer=all        | FileCheck %s --check-prefix=NO-ELIM
4 ; Implement -momit-leaf-frame-pointer
5 ; rdar://7886181
7 define i32 @t1() nounwind readnone {
8 entry:
9 ; FP-ELIM-LABEL:  t1:
10 ; FP-ELIM-NEXT:     movl
11 ; FP-ELIM-NEXT:     ret
13 ; NO-ELIM-LABEL:  t1:
14 ; NO-ELIM-NEXT:     pushl %ebp
15 ; NO-ELIM:          popl %ebp
16 ; NO-ELIM-NEXT:     ret
17   ret i32 10
20 define void @t2() nounwind {
21 entry:
22 ; FP-ELIM-LABEL:  t2:
23 ; FP-ELIM-NOT:      pushl %ebp
24 ; FP-ELIM:          ret
26 ; NO-ELIM-LABEL:  t2:
27 ; NO-ELIM-NEXT:     pushl %ebp
28 ; NO-ELIM:          popl %ebp
29 ; NO-ELIM-NEXT:     ret
30   tail call void @foo(i32 0) nounwind
31   ret void
34 ; The local non-leaf attribute takes precendece over the command line flag.
35 define i32 @t3() "frame-pointer"="non-leaf" nounwind readnone {
36 entry:
37 ; ANY-ELIM-LABEL:  t3:
38 ; ANY-ELIM-NEXT:     movl
39 ; ANY-ELIM-NEXT:     ret
40   ret i32 10
43 define void @t4() "frame-pointer"="non-leaf" nounwind {
44 entry:
45 ; ANY-ELIM-LABEL:  t4:
46 ; ANY-ELIM-NEXT:     pushl %ebp
47 ; ANY-ELIM:          popl %ebp
48 ; ANY-ELIM-NEXT:     ret
49   tail call void @foo(i32 0) nounwind
50   ret void
53 declare void @foo(i32)