diff --git a/flang/test/Semantics/bindings01.f90 b/flang/test/Semantics/bindings01.f90 --- a/flang/test/Semantics/bindings01.f90 +++ b/flang/test/Semantics/bindings01.f90 @@ -3,6 +3,7 @@ ! and C733, C734 and C779, C780, C782, C783, C784, and C785. module m + !WARNING: A derived type with the BIND attribute is empty !ERROR: An ABSTRACT derived type must be extensible type, abstract, bind(c) :: badAbstract1 end type @@ -44,6 +45,7 @@ end type type, extends(intermediate) :: concrete2 ! ensure no false missing binding error end type + !WARNING: A derived type with the BIND attribute is empty type, bind(c) :: inextensible1 end type !ERROR: The parent type is not extensible diff --git a/flang/test/Semantics/block-data01.f90 b/flang/test/Semantics/block-data01.f90 --- a/flang/test/Semantics/block-data01.f90 +++ b/flang/test/Semantics/block-data01.f90 @@ -11,7 +11,7 @@ procedure(sin), pointer :: q => cos !ERROR: 'p' may not be a procedure as it is in a COMMON block procedure(sin), pointer :: p => cos - common /block/ pi, p + common /block/ p, pi !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block integer :: inDataButNotCommon data inDataButNotCommon /1/ diff --git a/flang/test/Semantics/call03.f90 b/flang/test/Semantics/call03.f90 --- a/flang/test/Semantics/call03.f90 +++ b/flang/test/Semantics/call03.f90 @@ -165,7 +165,7 @@ character :: ch1 !ERROR: Actual argument variable length '1' is less than expected length '2' call ch2(ch1) - !WARN: Actual argument expression length '0' is less than expected length '2' + !WARNING: Actual argument expression length '0' is less than expected length '2' call ch2("") call pdtdefault(vardefault) call pdtdefault(var3) diff --git a/flang/test/Semantics/case01.f90 b/flang/test/Semantics/case01.f90 --- a/flang/test/Semantics/case01.f90 +++ b/flang/test/Semantics/case01.f90 @@ -129,7 +129,8 @@ end select select case (grade2) - case (51:50) ! warning + !WARNING: CASE has lower bound greater than upper bound + case (51:50) case (100:) case (:30) case (40) @@ -182,13 +183,13 @@ integer :: j select case(1_1) case (127) - !WARN: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression case (128) - !WARN: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression - !WARN: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression case (129:130) - !WARN: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression - !WARN: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression case (-130:-129) case (-128) !ERROR: Must be a scalar value, but is a rank-1 array diff --git a/flang/test/Semantics/common-blocks.f90 b/flang/test/Semantics/common-blocks.f90 --- a/flang/test/Semantics/common-blocks.f90 +++ b/flang/test/Semantics/common-blocks.f90 @@ -7,7 +7,7 @@ common x, y common /a/ xa, ya common /b/ xb, yb - !CHECK: portability: Blank COMMON object 'x' in a DATA statement is not standard + !WARNING: Blank COMMON object 'x' in a DATA statement is not standard data x /42./, xa /42./, yb/42./ end subroutine @@ -18,6 +18,7 @@ common /a/ xa, ya common /b/ xb, yb equivalence (yb, yb_eq) + !WARNING: Blank COMMON object 'x' in a DATA statement is not standard !ERROR: Multiple initialization of COMMON block /b/ data x /66./, xa /66./, yb_eq /66./ end subroutine diff --git a/flang/test/Semantics/data06.f90 b/flang/test/Semantics/data06.f90 --- a/flang/test/Semantics/data06.f90 +++ b/flang/test/Semantics/data06.f90 @@ -41,6 +41,7 @@ data rp/rfunc/ procedure(rfunc), pointer :: rpp real, target :: rt + !WARNING: Procedure pointer 'rpp' in a DATA statement is not standard !ERROR: Data object 'rt' may not be used to initialize 'rpp', which is a procedure pointer data rpp/rt/ !ERROR: Initializer for 'rt' must not be a pointer diff --git a/flang/test/Semantics/dosemantics02.f90 b/flang/test/Semantics/dosemantics02.f90 --- a/flang/test/Semantics/dosemantics02.f90 +++ b/flang/test/Semantics/dosemantics02.f90 @@ -23,10 +23,12 @@ INTEGER, PARAMETER :: constInt = 0 ! Warn on this one for backwards compatibility + !WARNING: DO step expression should not be zero DO 10 I = 1, 10, 0 10 CONTINUE ! Warn on this one for backwards compatibility + !WARNING: DO step expression should not be zero DO 20 I = 1, 10, 5 - 5 20 CONTINUE diff --git a/flang/test/Semantics/dosemantics12.f90 b/flang/test/Semantics/dosemantics12.f90 --- a/flang/test/Semantics/dosemantics12.f90 +++ b/flang/test/Semantics/dosemantics12.f90 @@ -392,6 +392,7 @@ call intentInOutSub(jvar, ivar) do ivar = 1,10 + !WARNING: Possible redefinition of DO variable 'ivar' call intentInOutSub(jvar, ivar) end do @@ -435,8 +436,8 @@ jvar = 83 + intentInFunc(intentOutFunc(ivar)) end do - ! Warning for passing a DO variable to an INTENT(INOUT) dummy do ivar = 1, 10 + !WARNING: Possible redefinition of DO variable 'ivar' jvar = intentInOutFunc(ivar) end do diff --git a/flang/test/Semantics/forall01.f90 b/flang/test/Semantics/forall01.f90 --- a/flang/test/Semantics/forall01.f90 +++ b/flang/test/Semantics/forall01.f90 @@ -41,6 +41,7 @@ end forall forall(i=1:10) forall(j=1:10) + !WARNING: FORALL index variable 'j' not used on left-hand side of assignment !ERROR: Cannot redefine FORALL variable 'i' i = 1 end forall @@ -81,14 +82,18 @@ x(i) = y(i) end forall forall(i=1:10) - x = y ! warning: i not used on LHS + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + x = y forall(j=1:10) - x(i) = y(i) ! warning: j not used on LHS - x(j) = y(j) ! warning: i not used on LHS + !WARNING: FORALL index variable 'j' not used on left-hand side of assignment + x(i) = y(i) + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + x(j) = y(j) endforall endforall do concurrent(i=1:10) x = y + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment forall(i=1:10) x = y end do end @@ -101,6 +106,7 @@ real, target :: b(10) forall(i=1:10) a(i)%p => b(i) - a(1)%p => b(i) ! warning: i not used on LHS + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + a(1)%p => b(i) end forall end diff --git a/flang/test/Semantics/int-literals.f90 b/flang/test/Semantics/int-literals.f90 --- a/flang/test/Semantics/int-literals.f90 +++ b/flang/test/Semantics/int-literals.f90 @@ -1,4 +1,4 @@ -! RUN: %python %S/test_errors.py %s %flang_fc1 +! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic ! Fortran syntax considers signed int literals in complex literals ! to be a distinct production, not an application of unary +/- to ! an unsigned int literal, so they're used here to test overflow diff --git a/flang/test/Semantics/resolve11.f90 b/flang/test/Semantics/resolve11.f90 --- a/flang/test/Semantics/resolve11.f90 +++ b/flang/test/Semantics/resolve11.f90 @@ -4,7 +4,7 @@ integer, private :: j !ERROR: The accessibility of 'i' has already been specified as PUBLIC private i - !The accessibility of 'j' has already been specified as PRIVATE + !WARNING: The accessibility of 'j' has already been specified as PRIVATE private j end diff --git a/flang/test/Semantics/resolve31.f90 b/flang/test/Semantics/resolve31.f90 --- a/flang/test/Semantics/resolve31.f90 +++ b/flang/test/Semantics/resolve31.f90 @@ -1,4 +1,4 @@ -! RUN: %python %S/test_errors.py %s %flang_fc1 +! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic ! C735 If EXTENDS appears, SEQUENCE shall not appear. ! C738 The same private-or-sequence shall not appear more than once in a ! given derived-type-def . @@ -49,8 +49,10 @@ type :: t1 private sequence - private ! not a fatal error - sequence ! not a fatal error + !WARNING: PRIVATE may not appear more than once in derived type components + private + !WARNING: SEQUENCE may not appear more than once in derived type components + sequence real :: t1Field end type type :: t1a @@ -83,7 +85,7 @@ class(*), allocatable :: typeStarField !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type type(plainType) :: testField1 - !Pointers are ok as an extension + !WARNING: A sequence type data component that is a pointer to a non-sequence type is not standard type(plainType), pointer :: testField1p type(sequenceType) :: testField2 procedure(real), pointer, nopass :: procField diff --git a/flang/test/Semantics/resolve35.f90 b/flang/test/Semantics/resolve35.f90 --- a/flang/test/Semantics/resolve35.f90 +++ b/flang/test/Semantics/resolve35.f90 @@ -78,6 +78,7 @@ do concurrent(integer::i=1:5) local(j, i) & !ERROR: 'j' is already declared in this scoping unit local_init(k, j) & + !WARNING: Variable 'a' with SHARED locality implicitly declared shared(a) a = j + 1 end do diff --git a/flang/test/Semantics/resolve42.f90 b/flang/test/Semantics/resolve42.f90 --- a/flang/test/Semantics/resolve42.f90 +++ b/flang/test/Semantics/resolve42.f90 @@ -1,7 +1,7 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 subroutine s1 - !ERROR: Array 'z' without ALLOCATABLE or POINTER attribute must have explicit shape - common x, y(4), z(:) + !ERROR: Array 'x' without ALLOCATABLE or POINTER attribute must have explicit shape + common x(:), y(4), z end subroutine s2 @@ -28,9 +28,9 @@ end function f6(x) result(r) - !ERROR: Dummy argument 'x' may not appear in a COMMON block !ERROR: ALLOCATABLE object 'y' may not appear in a COMMON block - common x,y,z + !ERROR: Dummy argument 'x' may not appear in a COMMON block + common y,x,z allocatable y !ERROR: Function result 'r' may not appear in a COMMON block common r diff --git a/flang/test/Semantics/resolve59.f90 b/flang/test/Semantics/resolve59.f90 --- a/flang/test/Semantics/resolve59.f90 +++ b/flang/test/Semantics/resolve59.f90 @@ -59,9 +59,11 @@ x = acos(f5) end function ! Sanity test: f18 handles C1560 violation by ignoring RESULT - function f6() result(f6) !OKI (warning) + !WARNING: The function name should not appear in RESULT, references to 'f6' inside the function will be considered as references to the result only + function f6() result(f6) end function - function f7() result(f7) !OKI (warning) + !WARNING: The function name should not appear in RESULT, references to 'f7' inside the function will be considered as references to the result only + function f7() result(f7) real :: x, f7 !ERROR: Recursive call to 'f7' requires a distinct RESULT in its declaration x = acos(f7()) diff --git a/flang/test/Semantics/resolve85.f90 b/flang/test/Semantics/resolve85.f90 --- a/flang/test/Semantics/resolve85.f90 +++ b/flang/test/Semantics/resolve85.f90 @@ -24,6 +24,7 @@ end type derived4 !WARNING: Attribute 'BIND(C)' cannot be used more than once + !WARNING: A derived type with the BIND attribute is empty type, bind(c), public, bind(c) :: derived5 end type derived5