xref: /llvm-project/flang/test/Semantics/structconst10.f90 (revision 10cc4a5fab3ad8da7a64ba784007b99a039134c1)
1*10cc4a5fSPeter Klausler! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror
2*10cc4a5fSPeter Klauslermodule m1
3*10cc4a5fSPeter Klausler  type a1
4*10cc4a5fSPeter Klausler     integer ::x1=1
5*10cc4a5fSPeter Klausler  end type a1
6*10cc4a5fSPeter Klausler  type,extends(a1)::a2
7*10cc4a5fSPeter Klausler     integer ::x2=3
8*10cc4a5fSPeter Klausler  end type a2
9*10cc4a5fSPeter Klausler  type,extends(a2)::a3
10*10cc4a5fSPeter Klausler     integer   ::x3=3
11*10cc4a5fSPeter Klausler  end type a3
12*10cc4a5fSPeter Klauslerend module m1
13*10cc4a5fSPeter Klausler
14*10cc4a5fSPeter Klauslerprogram test
15*10cc4a5fSPeter Klausler  use m1
16*10cc4a5fSPeter Klausler  type(a3) v
17*10cc4a5fSPeter Klausler  !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous
18*10cc4a5fSPeter Klausler  v=a3(a2(x1=18,x2=6),x3=6)
19*10cc4a5fSPeter Klausler  !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous
20*10cc4a5fSPeter Klausler  v=a3(a1(x1=18),x2=6,x3=6)
21*10cc4a5fSPeter Klausler  !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous
22*10cc4a5fSPeter Klausler  !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous
23*10cc4a5fSPeter Klausler  v=a3(a2(a1(x1=18),x2=6),x3=6)
24*10cc4a5fSPeter Klausler  v=a3(a2=a2(a1=a1(x1=18),x2=6),x3=6) ! ok
25*10cc4a5fSPeter Klauslerend
26