[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve86.f90
blobc4950b40fcf524d379a2f5702466529f3203cdc4
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! C736 If EXTENDS appears and the type being defined has a coarray ultimate
4 ! component, its parent type shall have a coarray ultimate component.
6 subroutine s()
7 type coarrayParent
8 real,allocatable, codimension[:] :: parentField
9 end type coarrayParent
11 type, extends(coarrayParent) :: goodChildType
12 real, allocatable, codimension[:] :: childField
13 end type goodChildType
15 type, extends(coarrayParent) :: brotherType
16 real :: brotherField
17 end type brotherType
19 type, extends(brotherType) :: grandChildType
20 real, allocatable, codimension[:] :: grandChildField
21 end type grandChildType
23 type plainParent
24 end type plainParent
26 !ERROR: Type 'badchildtype' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component
27 type, extends(plainParent) :: badChildType
28 real, allocatable, codimension[:] :: childField
29 end type badChildType
31 type, extends(plainParent) :: plainChild
32 real :: realField
33 end type plainChild
35 !ERROR: Type 'badchildtype2' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component
36 type, extends(plainChild) :: badChildType2
37 real, allocatable, codimension[:] :: childField
38 end type badChildType2
40 !ERROR: Type 'badchildtype3' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component
41 type, extends(plainParent) :: badChildType3
42 type(coarrayParent) :: childField
43 end type badChildType3
45 end subroutine s