mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 22:06:38 +00:00

Following RFC at https://discourse.llvm.org/t/rfc-ffp-contract-default-value/66301 This adds the `fastmath<contract>` attribute to `fir.call` and some floating point arithmetic operations (hence the many test changes). Instead of testing for this specific attribute, I am using a regular expression to match any attributes.
17 lines
551 B
Fortran
17 lines
551 B
Fortran
! RUN: bbc -emit-fir %s -o - | FileCheck %s
|
|
|
|
! Test lowering of non standard features.
|
|
|
|
! Test mismatch on result type between callee/caller
|
|
! CHECK-LABEL: func @_QPexpect_i32
|
|
subroutine expect_i32()
|
|
external :: returns_i32
|
|
real(4) :: returns_i32
|
|
! CHECK: %[[funcAddr:.*]] = fir.address_of(@_QPreturns_i32) : () -> i32
|
|
! CHECK: %[[funcCast:.*]] = fir.convert %[[funcAddr]] : (() -> i32) -> (() -> f32)
|
|
! CHECK: fir.call %[[funcCast]]() {{.*}}: () -> f32
|
|
print *, returns_i32()
|
|
end subroutine
|
|
integer(4) function returns_i32()
|
|
end function
|