CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
63 lines
2.0 KiB
Fortran
63 lines
2.0 KiB
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Test AT edit descriptor (Fortran 2023)
|
|
|
|
character(10) :: str
|
|
character(kind=2,len=10) :: str2
|
|
character(kind=4,len=10) :: str4
|
|
|
|
! Valid: AT with WRITE
|
|
write(*, '(AT)') 'hello'
|
|
write(*, '(AT)') str
|
|
write(*, '(2AT)') 'abc', 'def'
|
|
|
|
! Valid: AT with non-default character kinds
|
|
write(*, '(AT)') str2
|
|
write(*, '(AT)') str4
|
|
write(*, '(2AT)') str2, str4
|
|
|
|
! Valid: AT in FORMAT statement for WRITE
|
|
1 format(AT)
|
|
write(*,1) 'hello'
|
|
|
|
! Error: AT must not be used for input
|
|
!ERROR: 'AT' edit descriptor must not be used for input
|
|
read(*, '(AT)') str
|
|
|
|
! Error: AT must not be used for input with non-default kinds
|
|
!ERROR: 'AT' edit descriptor must not be used for input
|
|
read(*, '(AT)') str2
|
|
!ERROR: 'AT' edit descriptor must not be used for input
|
|
read(*, '(AT)') str4
|
|
|
|
! AT does not accept a width
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
write(*, '(AT10)') str
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
!ERROR: Unexpected '.' in format expression
|
|
write(*, '(AT10.2)') str
|
|
|
|
! AT with width on input produces two and three independent errors.
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
!ERROR: 'AT' edit descriptor must not be used for input
|
|
read(*, '(AT10)') str
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
!ERROR: 'AT' edit descriptor must not be used for input
|
|
!ERROR: Unexpected '.' in format expression
|
|
read(*, '(AT10.2)') str
|
|
|
|
! FORMAT statements are standalone; the compiler cannot know if they will
|
|
! be used with READ or WRITE, so no compile-time error is expected here.
|
|
2 format(AT)
|
|
read(*,2) str
|
|
|
|
! AT with width in FORMAT statements; report compiling error, but not
|
|
! READ error.
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
3 format(AT10)
|
|
write(*,3) str
|
|
!ERROR: 'AT' edit descriptor does not accept a width value
|
|
!ERROR: Unexpected '.' in format expression
|
|
4 format(AT10.2)
|
|
read(*,4) str
|
|
end
|