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
99 lines
3.5 KiB
Fortran
99 lines
3.5 KiB
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Check for semantic errors in split() subroutine calls
|
|
! Based on Fortran 2023 standard requirements
|
|
|
|
program test_split_errors
|
|
implicit none
|
|
|
|
character(20) :: string
|
|
character(5) :: set
|
|
integer :: pos
|
|
logical :: back
|
|
|
|
! Valid declarations for testing
|
|
integer :: int_scalar
|
|
real :: real_scalar
|
|
character(10) :: string_array(5)
|
|
character(5) :: set_array(5)
|
|
character(len=20, kind=2) :: string_k2
|
|
character(len=5, kind=2) :: set_k2
|
|
character(len=20, kind=4) :: string_k4
|
|
character(len=5, kind=4) :: set_k4
|
|
|
|
!========================================================================
|
|
! Valid calls (reference)
|
|
!========================================================================
|
|
|
|
call split(string, set, pos)
|
|
call split(string, set, pos, back)
|
|
call split("hello world", " ", pos)
|
|
call split("hello world", " ", pos, .false.)
|
|
|
|
! Valid calls with different character kinds
|
|
call split(string_k2, set_k2, pos)
|
|
call split(string_k2, set_k2, pos, back)
|
|
call split(string_k4, set_k4, pos)
|
|
call split(string_k4, set_k4, pos, back)
|
|
|
|
!========================================================================
|
|
! Wrong types for STRING argument
|
|
!========================================================================
|
|
|
|
!ERROR: Actual argument for 'string=' has bad type 'INTEGER(4)'
|
|
call split(int_scalar, set, pos)
|
|
|
|
!ERROR: Actual argument for 'string=' has bad type 'REAL(4)'
|
|
call split(real_scalar, set, pos)
|
|
|
|
!========================================================================
|
|
! Wrong rank for STRING (must be scalar)
|
|
!========================================================================
|
|
|
|
!ERROR: 'string=' argument has unacceptable rank 1
|
|
call split(string_array, set, pos)
|
|
|
|
!========================================================================
|
|
! Wrong types for SET argument
|
|
!========================================================================
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type 'INTEGER(4)'
|
|
call split(string, int_scalar, pos)
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type 'REAL(4)'
|
|
call split(string, real_scalar, pos)
|
|
|
|
!========================================================================
|
|
! Wrong types for POS argument
|
|
!========================================================================
|
|
|
|
!ERROR: Actual argument for 'pos=' has bad type 'REAL(4)'
|
|
call split(string, set, real_scalar)
|
|
|
|
!========================================================================
|
|
! Wrong types for BACK argument
|
|
!========================================================================
|
|
|
|
!ERROR: Actual argument for 'back=' has bad type 'INTEGER(4)'
|
|
call split(string, set, pos, int_scalar)
|
|
|
|
!========================================================================
|
|
! Character kind mismatches between STRING and SET
|
|
!========================================================================
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type or kind 'CHARACTER(KIND=1,LEN=5_8)'
|
|
call split(string_k2, set, pos)
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type or kind 'CHARACTER(KIND=2,LEN=5_8)'
|
|
call split(string, set_k2, pos)
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type or kind 'CHARACTER(KIND=1,LEN=5_8)'
|
|
call split(string_k4, set, pos)
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type or kind 'CHARACTER(KIND=4,LEN=5_8)'
|
|
call split(string, set_k4, pos)
|
|
|
|
!ERROR: Actual argument for 'set=' has bad type or kind 'CHARACTER(KIND=4,LEN=5_8)'
|
|
call split(string_k2, set_k4, pos)
|
|
|
|
end program test_split_errors
|