annotate gcc/testsuite/gfortran.dg/c_assoc_2.f03 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 module c_assoc_2
kono
parents:
diff changeset
3 use, intrinsic :: iso_c_binding, only: c_ptr, c_associated
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 contains
kono
parents:
diff changeset
6 subroutine sub0(my_c_ptr) bind(c)
kono
parents:
diff changeset
7 type(c_ptr), value :: my_c_ptr
kono
parents:
diff changeset
8 type(c_ptr), pointer :: my_c_ptr_2
kono
parents:
diff changeset
9 integer :: my_integer
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 if(.not. c_associated(my_c_ptr)) then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
12 STOP 1
111
kono
parents:
diff changeset
13 end if
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 if(.not. c_associated(my_c_ptr, my_c_ptr)) then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
16 STOP 2
111
kono
parents:
diff changeset
17 end if
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 if(.not. c_associated(my_c_ptr, my_c_ptr, my_c_ptr)) then ! { dg-error "Too many arguments in call" }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20 STOP 3
111
kono
parents:
diff changeset
21 end if
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 if(.not. c_associated()) then ! { dg-error "Missing actual argument" }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
24 STOP 4
111
kono
parents:
diff changeset
25 end if
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 if(.not. c_associated(my_c_ptr_2)) then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 STOP 5
111
kono
parents:
diff changeset
29 end if
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 if(.not. c_associated(my_integer)) then ! { dg-error "shall have the type TYPE.C_PTR. or TYPE.C_FUNPTR." }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
32 STOP 6
111
kono
parents:
diff changeset
33 end if
kono
parents:
diff changeset
34 end subroutine sub0
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 end module c_assoc_2