[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / oldparam02.f90
blobd3f56ee8d1d735ebe377a225dde34e713e872210
1 ! RUN: not %flang -falternative-parameter-statement -fsyntax-only %s 2>&1 | FileCheck %s
3 ! Error tests for "old style" PARAMETER statements
4 subroutine 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
28 end