23 lines · plain
1! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s --allow-empty2! Verify portability warning on usage that trips over a F202X breaking change3program main4 character(:), allocatable :: str5 real, allocatable :: x6 allocate(character(10)::str)7!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for Internal file8 write(str, 1) 3.1415991 format(F6.4)10 print 2, str112 format('>',a,'<')12!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for IOMSG=13 open(1,file="/dev/nonexistent",status="old",iomsg=str)14!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for ENCODING15 inquire(6,encoding=str)16!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for ERRMSG=17 allocate(x,errmsg=str)18!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for ERRMSG=19 deallocate(x,errmsg=str)20!CHECK: portability: The deferred length allocatable character scalar variable 'str' may be reallocated to a different length under the new Fortran 202X standard semantics for dummy argument 'cmdmsg='21 call execute_command_line("true", cmdmsg=str)22end23