mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 21:56:34 +00:00

For proper error detection of bad KIND= arguments, make IEEE_INT and IEEE_REAL actual intrinsic functions. Lowering will have to check for the new __builtin_ names.
13 lines
537 B
Fortran
13 lines
537 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
use ieee_arithmetic, only: ieee_int, ieee_real, ieee_up
|
|
implicit none
|
|
print *, ieee_int(1.5, ieee_up)
|
|
print *, ieee_int(1.5, ieee_up, 4)
|
|
!ERROR: 'kind=' argument must be a constant scalar integer whose value is a supported kind for the intrinsic result type
|
|
print *, ieee_int(1.5, ieee_up, 3)
|
|
print *, ieee_real(1)
|
|
print *, ieee_real(1, 4)
|
|
!ERROR: 'kind=' argument must be a constant scalar integer whose value is a supported kind for the intrinsic result type
|
|
print *, ieee_real(1, 7)
|
|
end
|