xref: /llvm-project/flang/test/Semantics/oldparam02.f90 (revision 96aa48100c0b332b6e6821b664ad2fa5615c976a)
1! RUN: not %flang -falternative-parameter-statement -fsyntax-only %s 2>&1 | FileCheck %s
2
3! Error tests for "old style" PARAMETER statements
4subroutine subr(x1,x2,x3,x4,x5)
5  type(*), intent(in) :: x1
6  class(*), intent(in) :: x2
7  real, intent(in) :: x3(*)
8  real, intent(in) :: x4(:)
9  character(*), intent(in) :: x5
10  !CHECK: error: TYPE(*) dummy argument may only be used as an actual argument
11  parameter p1 = x1
12  !CHECK: error: Must be a constant value
13  parameter p2 = x2
14  !CHECK: error: Whole assumed-size array 'x3' may not appear here without subscripts
15  !CHECK: error: Must be a constant value
16  parameter p3 = x3
17  !CHECK: error: Must be a constant value
18  parameter p4 = x4
19  !CHECK: error: Must be a constant value
20  parameter p5 = x5
21  !CHECK: The expression must be a constant of known type
22  parameter p6 = z'feedfacedeadbeef'
23  !CHECK: error: Must be a constant value
24  parameter p7 = len(x5)
25  real :: p8
26  !CHECK: error: Alternative style PARAMETER 'p8' must not already have an explicit type
27  parameter p8 = 666
28end
29