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: %llvm2ice -O2 --verbose none %s \ | 6 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
9 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 9 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
10 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 10 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
12 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 12 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
13 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 13 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
14 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | |
15 ; RUN: | FileCheck --check-prefix=DUMP %s | |
16 | 14 |
17 define float @dummy() { | 15 define float @dummy() { |
18 entry: | 16 entry: |
19 ret float 0.000000e+00 | 17 ret float 0.000000e+00 |
20 } | 18 } |
21 ; CHECK-LABEL: dummy | 19 ; CHECK-LABEL: dummy |
22 | 20 |
23 ; The call is ignored, but the top of the FP stack still needs to be | 21 ; The call is ignored, but the top of the FP stack still needs to be |
24 ; popped. | 22 ; popped. |
25 define i32 @ignored_fp_call() { | 23 define i32 @ignored_fp_call() { |
(...skipping 25 matching lines...) Expand all Loading... |
51 %fp = call float @dummy() | 49 %fp = call float @dummy() |
52 ret float %fp | 50 ret float %fp |
53 } | 51 } |
54 ; CHECK-LABEL: returned_fp_call | 52 ; CHECK-LABEL: returned_fp_call |
55 ; CHECK: call dummy | 53 ; CHECK: call dummy |
56 ; CHECK: fstp | 54 ; CHECK: fstp |
57 ; CHECK: fld | 55 ; CHECK: fld |
58 | 56 |
59 ; ERRORS-NOT: ICE translation error | 57 ; ERRORS-NOT: ICE translation error |
60 ; DUMP-NOT: SZ | 58 ; DUMP-NOT: SZ |
OLD | NEW |