blob: cc67472f349f242651b2ae2632353b5fef8ed2b6 [file] [log] [blame]
Alex Bradbury8f296472018-04-12 05:36:44 +00001; 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
5declare 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
11define 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)
16; RV32IFD-NEXT: lui a2, %hi(floor)
17; RV32IFD-NEXT: addi a2, a2, %lo(floor)
18; RV32IFD-NEXT: jalr a2
19; RV32IFD-NEXT: lw ra, 12(sp)
20; RV32IFD-NEXT: addi sp, sp, 16
21; RV32IFD-NEXT: ret
22 %1 = call double @llvm.floor.f64(double %a)
23 ret double %1
24}