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 --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s | 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ |
7 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s | 7 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
| 8 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 \ |
| 9 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
8 | 10 |
9 declare float @dummy() | 11 declare float @dummy() |
10 | 12 |
11 ; The call is ignored, but the top of the FP stack still needs to be | 13 ; The call is ignored, but the top of the FP stack still needs to be |
12 ; popped. | 14 ; popped. |
13 define i32 @ignored_fp_call() { | 15 define i32 @ignored_fp_call() { |
14 entry: | 16 entry: |
15 %ignored = call float @dummy() | 17 %ignored = call float @dummy() |
16 ret i32 0 | 18 ret i32 0 |
17 } | 19 } |
(...skipping 18 matching lines...) Expand all Loading... |
36 ; re-pushing, in which case the test would need to be changed. | 38 ; re-pushing, in which case the test would need to be changed. |
37 define float @returned_fp_call() { | 39 define float @returned_fp_call() { |
38 entry: | 40 entry: |
39 %fp = call float @dummy() | 41 %fp = call float @dummy() |
40 ret float %fp | 42 ret float %fp |
41 } | 43 } |
42 ; CHECK-LABEL: returned_fp_call | 44 ; CHECK-LABEL: returned_fp_call |
43 ; CHECK: call {{.*}} R_{{.*}} dummy | 45 ; CHECK: call {{.*}} R_{{.*}} dummy |
44 ; CHECK: fstp | 46 ; CHECK: fstp |
45 ; CHECK: fld | 47 ; CHECK: fld |
OLD | NEW |