| 1 |
! { dg-lto-do link } |
| 2 |
! { dg-lto-options {{ -O0 -flto }} } |
| 3 |
! |
| 4 |
! PR fortran/102885 |
| 5 |
|
| 6 |
module m |
| 7 |
use iso_c_binding, only: c_char |
| 8 |
implicit none (type, external) |
| 9 |
|
| 10 |
contains |
| 11 |
|
| 12 |
! Assumed-shape array, nonallocatable/nonpointer |
| 13 |
|
| 14 |
subroutine ar3 (xn, n) bind(C) |
| 15 |
integer :: n |
| 16 |
character(len=n) :: xn(..) |
| 17 |
if (size(xn) /= 6) stop |
| 18 |
if (len(xn) /= 5) stop |
| 19 |
select rank(xn) |
| 20 |
rank(1) |
| 21 |
xn = ['FDGhf', & |
| 22 |
'hdrhg', & |
| 23 |
'fDgFl', & |
| 24 |
'DFHs3', & |
| 25 |
'4a54G', & |
| 26 |
'hSs6k'] |
| 27 |
rank default |
| 28 |
stop |
| 29 |
end select |
| 30 |
end |
| 31 |
|
| 32 |
end |
| 33 |
|
| 34 |
program main |
| 35 |
use m |
| 36 |
implicit none (type, external) |
| 37 |
character(kind=c_char, len=5) :: str5a6(6) |
| 38 |
|
| 39 |
! assumed rank - with array descriptor |
| 40 |
|
| 41 |
str5a6 = ['DDGhf', & |
| 42 |
'hdrh$', & |
| 43 |
'fDGSl', & |
| 44 |
'DFHs3', & |
| 45 |
'43grG', & |
| 46 |
'hFG$k'] |
| 47 |
call ar3 (str5a6, 5) |
| 48 |
|
| 49 |
end |