repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git]
/
gcc
/
testsuite
/
gfortran.dg
/
allocate_alloc_opt_10.f90
blob
f9d92381f952e6712f373f0cafc7c8a132949416
1
! { dg-do run }
2
!
3
! PR 43388: [F2008][OOP] ALLOCATE with MOLD=
4
!
5
! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7
type
::
t1
8
integer
::
i
9
end type
10
11
type
,
extends
(
t1
) ::
t2
12
integer
::
j
=
4
13
end type
14
15
class
(
t1
),
allocatable
::
x
,
y
16
type
(
t2
) ::
z
17
18
19
!!! first example (static)
20
21
z
%
j
=
5
22
allocate
(
x
,
MOLD
=
z
)
23
24
select
type
(
x
)
25
type
is
(
t2
)
26
print
*,
x
%
j
27
if
(
x
%
j
/=
4
)
STOP
1
28
x
%
j
=
5
29
class default
30
STOP
1
31
end
select
32
33
34
!!! second example (dynamic, PR 44541)
35
36
allocate
(
y
,
MOLD
=
x
)
37
38
select
type
(
y
)
39
type
is
(
t2
)
40
print
*,
y
%
j
41
if
(
y
%
j
/=
4
)
STOP
2
42
class default
43
STOP
2
44
end
select
45
46
end