| OLD | NEW |
| 1 ; Test that for calls returning a floating-point value, the calling | 1 ; Test that for calls returning a floating-point value, the calling |
| 2 ; ABI with respect to the x87 floating point stack is honored. In | 2 ; ABI with respect to the x87 floating point stack is honored. In |
| 3 ; particular, the top-of-stack must be popped regardless of whether | 3 ; particular, the top-of-stack must be popped regardless of whether |
| 4 ; its value is used. | 4 ; its value is used. |
| 5 | 5 |
| 6 ; RUN: %p2i --assemble --disassemble -i %s --args -O2 --verbose none \ | 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s |
| 7 ; RUN: | FileCheck %s | 7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s |
| 8 ; RUN: %p2i --assemble --disassemble -i %s --args -Om1 --verbose none \ | |
| 9 ; RUN: | FileCheck %s | |
| 10 | 8 |
| 11 declare float @dummy() | 9 declare float @dummy() |
| 12 | 10 |
| 13 ; The call is ignored, but the top of the FP stack still needs to be | 11 ; The call is ignored, but the top of the FP stack still needs to be |
| 14 ; popped. | 12 ; popped. |
| 15 define i32 @ignored_fp_call() { | 13 define i32 @ignored_fp_call() { |
| 16 entry: | 14 entry: |
| 17 %ignored = call float @dummy() | 15 %ignored = call float @dummy() |
| 18 ret i32 0 | 16 ret i32 0 |
| 19 } | 17 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 ; re-pushing, in which case the test would need to be changed. | 36 ; re-pushing, in which case the test would need to be changed. |
| 39 define float @returned_fp_call() { | 37 define float @returned_fp_call() { |
| 40 entry: | 38 entry: |
| 41 %fp = call float @dummy() | 39 %fp = call float @dummy() |
| 42 ret float %fp | 40 ret float %fp |
| 43 } | 41 } |
| 44 ; CHECK-LABEL: returned_fp_call | 42 ; CHECK-LABEL: returned_fp_call |
| 45 ; CHECK: call {{.*}} R_{{.*}} dummy | 43 ; CHECK: call {{.*}} R_{{.*}} dummy |
| 46 ; CHECK: fstp | 44 ; CHECK: fstp |
| 47 ; CHECK: fld | 45 ; CHECK: fld |
| OLD | NEW |