gcc/testsuite/gfortran.dg/pdt_33.f03
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Test the fix for PR102003, where len parameters where not returned as constants. |
| 4 | ! |
| 5 | ! Contributed by Harald Anlauf <[email protected]> |
| 6 | ! |
| 7 | program pr102003 |
| 8 | type pdt(n) |
| 9 | integer, len :: n = 8 |
| 10 | character(len=n) :: c |
| 11 | end type pdt |
| 12 | type(pdt(42)) :: p |
| 13 | integer, parameter :: m = len (p% c) |
| 14 | integer, parameter :: lm = p% c% len |
| 15 | |
| 16 | if (m /= 42) stop 1 |
| 17 | if (len (p% c) /= 42) stop 2 |
| 18 | if (lm /= 42) stop 3 |
| 19 | if (p% c% len /= 42) stop 4 |
| 20 | end |
| 21 |