annotate gcc/testsuite/gfortran.dg/pr21177.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! PR fortran/21177
kono
parents:
diff changeset
3 module mymod
kono
parents:
diff changeset
4 interface tt
kono
parents:
diff changeset
5 module procedure tt_i, tt_r, tt_l, tt_c4, tt_c8
kono
parents:
diff changeset
6 end interface tt
kono
parents:
diff changeset
7 contains
kono
parents:
diff changeset
8 function tt_l(x) result(y)
kono
parents:
diff changeset
9 integer :: y
kono
parents:
diff changeset
10 logical, pointer :: x
kono
parents:
diff changeset
11 y = 0
kono
parents:
diff changeset
12 end function
kono
parents:
diff changeset
13 function tt_i(x) result(y)
kono
parents:
diff changeset
14 integer :: y
kono
parents:
diff changeset
15 integer, pointer :: x
kono
parents:
diff changeset
16 y = 1
kono
parents:
diff changeset
17 end function
kono
parents:
diff changeset
18 function tt_r(x) result(y)
kono
parents:
diff changeset
19 integer :: y
kono
parents:
diff changeset
20 real, pointer :: x
kono
parents:
diff changeset
21 y = 2
kono
parents:
diff changeset
22 end function
kono
parents:
diff changeset
23 function tt_c4(x) result(y)
kono
parents:
diff changeset
24 integer :: y
kono
parents:
diff changeset
25 complex(4), pointer :: x
kono
parents:
diff changeset
26 y = 3
kono
parents:
diff changeset
27 end function
kono
parents:
diff changeset
28 function tt_c8(x) result(y)
kono
parents:
diff changeset
29 integer :: y
kono
parents:
diff changeset
30 complex(8), pointer :: x
kono
parents:
diff changeset
31 y = 4
kono
parents:
diff changeset
32 end function
kono
parents:
diff changeset
33 end module mymod
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 program test
kono
parents:
diff changeset
36 use mymod
kono
parents:
diff changeset
37 logical, pointer :: l
kono
parents:
diff changeset
38 integer, pointer :: i
kono
parents:
diff changeset
39 real, pointer :: r
kono
parents:
diff changeset
40 complex(4), pointer :: c4
kono
parents:
diff changeset
41 complex(8), pointer :: c8
kono
parents:
diff changeset
42
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
43 if (tt(l) /= 0) STOP 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
44 if (tt(i) /= 1) STOP 2
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 if (tt(r) /= 2) STOP 3
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
46 if (tt(c4) /= 3) STOP 4
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
47 if (tt(c8) /= 4) STOP 5
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
48 if (tt(null(l)) /= 0) STOP 6
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
49 if (tt(null(i)) /= 1) STOP 7
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
50 if (tt(null(r)) /= 2) STOP 8
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
51 if (tt(null(c4)) /= 3) STOP 9
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
52 if (tt(null(c8)) /= 4) STOP 10
111
kono
parents:
diff changeset
53 end program test