Alex Bradbury | 8f29647 | 2018-04-12 05:36:44 +0000 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | ; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \ |
| 3 | ; RUN: | FileCheck -check-prefix=RV32IFD %s |
| 4 | |
| 5 | declare double @llvm.floor.f64(double) |
| 6 | |
| 7 | ; The call to ffloor is introduced very late, meaning this test case covers |
| 8 | ; aspects of passing f64 on RV32D soft-float that double-calling-conv.ll |
| 9 | ; doesn't. |
| 10 | |
| 11 | define double @foo(double %a) nounwind { |
| 12 | ; RV32IFD-LABEL: foo: |
| 13 | ; RV32IFD: # %bb.0: |
| 14 | ; RV32IFD-NEXT: addi sp, sp, -16 |
| 15 | ; RV32IFD-NEXT: sw ra, 12(sp) |
Shiva Chen | d58bd8d | 2018-04-25 14:19:12 +0000 | [diff] [blame] | 16 | ; RV32IFD-NEXT: call floor |
Alex Bradbury | 8f29647 | 2018-04-12 05:36:44 +0000 | [diff] [blame] | 17 | ; RV32IFD-NEXT: lw ra, 12(sp) |
| 18 | ; RV32IFD-NEXT: addi sp, sp, 16 |
| 19 | ; RV32IFD-NEXT: ret |
| 20 | %1 = call double @llvm.floor.f64(double %a) |
| 21 | ret double %1 |
| 22 | } |