Index: flang/test/Semantics/synchronization01.f90 =================================================================== --- /dev/null +++ flang/test/Semantics/synchronization01.f90 @@ -0,0 +1,59 @@ +! RUN: %python %S/test_errors.py %s %flang_fc1 +! XFAIL: * +! This test checks for semantic errors in sync all statements based on the +! statement specification in section 11.6.3 of the Fortran 2018 standard. + +program test_sync_all + implicit none + + integer sync_status, co_indexed_integer[*], superfluous_stat + character(len=128) error_message, co_indexed_character[*], superfluous_errmsg + logical invalid_stat_variable_type, invalid_errmsg_variable_type + + !___ standard-conforming calls ___ + + sync all + sync all(stat=sync_status) + sync all( errmsg=error_message) + sync all(stat=sync_status, errmsg=error_message) + + !___ non-standard-conforming calls ___ + + !ERROR: expected execution part construct + sync all(invalid_stat_specifier=sync_status) + + !ERROR: expected execution part construct + sync all(stat=invalid_stat_variable_type) + + !ERROR: expected execution part construct + sync all(errmsg=invalid_errmsg_variable_type) + + !ERROR: expected execution part construct + sync all(sync_status) + + !ERROR: expected execution part construct + sync all( sync_status, errmsg=error_message) + + !ERROR: expected execution part construct + sync all( errmsg) + + !ERROR: expected execution part construct + sync all( sync_status, errmsg) + + ! Check constraint C1172 from the Fortran 2018 standard + !ERROR: to be determined + sync all(stat=sync_status, stat=superfluous_stat) + + ! Check constraint C1172 from the Fortran 2018 standard + !ERROR: to be determined + sync all(errmsg=error_message, errmsg=superfluous_errmsg) + + ! Check constraint C1173 from the Fortran 2018 standard + !ERROR: to be determined + sync all(stat=co_indexed_integer[1]) + + ! Check constraint C1173 from the Fortran 2018 standard + !ERROR: to be determined + sync all(errmsg=co_indexed_character[1]) + +end program test_sync_all