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.
21 lines
616 B
Fortran
21 lines
616 B
Fortran
! RUN: bbc -emit-fir -o - %s | FileCheck %s
|
|
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
|
|
|
|
! CHECK-LABEL: func @_QPfail_image_test
|
|
subroutine fail_image_test(fail)
|
|
logical :: fail
|
|
! CHECK: cond_br {{.*}}, ^[[BB1:.*]], ^[[BB2:.*]]
|
|
! CHECK: ^[[BB1]]:
|
|
if (fail) then
|
|
! CHECK: {{.*}} = fir.call @_FortranAFailImageStatement() {{.*}}: () -> none
|
|
! CHECK-NEXT: fir.unreachable
|
|
FAIL IMAGE
|
|
end if
|
|
! CHECK: ^[[BB2]]:
|
|
! CHECK-NEXT: br ^[[BB3:.*]]
|
|
! CHECK-NEXT: ^[[BB3]]
|
|
! CHECK-NEXT: return
|
|
return
|
|
end subroutine
|
|
! CHECK-LABEL: func private @_FortranAFailImageStatement() -> none attributes {fir.runtime}
|