gcc/testsuite/gfortran.dg/class_18.f03
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! PR 43207: [OOP] ICE for class pointer => null() initialization |
| 4 | ! |
| 5 | ! Original test case by Tobias Burnus <[email protected]> |
| 6 | ! Modified by Janus Weil <[email protected]> |
| 7 | |
| 8 | implicit none |
| 9 | type :: parent |
| 10 | end type |
| 11 | type(parent), target :: t |
| 12 | class(parent), pointer :: cp => null() |
| 13 | |
| 14 | if (associated(cp)) STOP 1 |
| 15 | cp => t |
| 16 | if (.not. associated(cp)) STOP 2 |
| 17 | |
| 18 | end |