[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve14.f90
blob78b80ae8de935437c5654bfe6f8f7a20ecdb09d1
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m1
3 integer :: x
4 integer :: y
5 integer :: z
6 integer, parameter :: k1 = selected_int_kind(9)
7 end
8 module m2
9 real :: y
10 real :: z
11 real :: w
12 integer, parameter :: k2 = selected_int_kind(9)
13 end
15 subroutine p1
16 use m1
17 use m2
18 ! check that selected_int_kind is not use-associated
19 integer, parameter :: k = selected_int_kind(9)
20 end
22 program p2
23 use m1, xx => x, y => z
24 use m2
25 volatile w
26 !ERROR: Cannot change CONTIGUOUS attribute on use-associated 'w'
27 contiguous w
28 !ERROR: 'z' is use-associated from module 'm2' and cannot be re-declared
29 integer z
30 !ERROR: Reference to 'y' is ambiguous
31 y = 1
32 end