Files
clang-p2996/flang/test/Semantics/etime.f90
jiajie zhang dc8d70acf7 [reland][flang] Add ETIME runtime and lowering intrinsics implementation (#92571)
This is same as https://github.com/llvm/llvm-project/pull/90578 with an
added fix. This PR updated tests of etime intrinsic due to Lowering
changes for assigning dummy_scope to hlfir.declare. Referring to
https://github.com/llvm/llvm-project/pull/92472 and
https://github.com/llvm/llvm-project/pull/90989
2024-05-18 01:00:25 +08:00

30 lines
914 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
! Tests for the ETIME intrinsics
subroutine bad_kind_error(values, time)
REAL(KIND=8), DIMENSION(2) :: values
REAL(KIND=8) :: time
!ERROR: Actual argument for 'values=' has bad type or kind 'REAL(8)'
call etime(values, time)
end subroutine bad_kind_error
subroutine bad_args_error(values)
REAL(KIND=4), DIMENSION(2) :: values
!ERROR: missing mandatory 'time=' argument
call etime(values)
end subroutine bad_args_error
subroutine bad_apply_form(values)
REAL(KIND=4), DIMENSION(2) :: values
REAL(KIND=4) :: time
!Declaration of 'etime'
call etime(values, time)
!ERROR: Cannot call subroutine 'etime' like a function
time = etime(values)
end subroutine bad_apply_form
subroutine good_kind_equal(values, time)
REAL(KIND=4), DIMENSION(2) :: values
REAL(KIND=4) :: time
call etime(values, time)
end subroutine good_kind_equal