PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / extends_11.f03
blob7b32cdf547f822c927474b5ffb62564d7b0623e7
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! PR fortran/45586
5 ! Test that access to inherited components are properly generated
7 ! Stripped down from extends_1.f03
9   type :: person
10     integer :: ss = 1
11   end type person
13   type, extends(person) :: education
14     integer ::  attainment = 0
15   end type education
17   type, extends(education) :: service
18     integer :: personnel_number = 0
19   end type service
21   type, extends(service) :: person_record
22     type (person_record), pointer :: supervisor => NULL ()
23   end type person_record
24   
25   type(person_record) :: recruit
26   
28   ! Check that references by ultimate component and by parent type work
29   ! All the following component access are equivalent
30   recruit%ss = 2
31   recruit%person%ss = 3
32   recruit%education%ss = 4
33   recruit%education%person%ss = 5
34   recruit%service%ss = 6
35   recruit%service%person%ss = 7
36   recruit%service%education%ss = 8
37   recruit%service%education%person%ss = 9
38 end
40 ! { dg-final { scan-tree-dump-times " +recruit\\.service\\.education\\.person\\.ss =" 8 "original"} }