annotate gcc/testsuite/gfortran.dg/pr61960.f90 @ 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 04ced10e8804
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
kono
parents:
diff changeset
3 module data_func_mod
kono
parents:
diff changeset
4 implicit none
kono
parents:
diff changeset
5 integer, parameter :: sp = 4
kono
parents:
diff changeset
6 type :: data_type
kono
parents:
diff changeset
7 real(kind=sp), pointer, dimension(:, :) :: data => null()
kono
parents:
diff changeset
8 integer :: nr_rows = 0, nr_cols = 0
kono
parents:
diff changeset
9 end type data_type
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 contains
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 function get_row(this, i) result(row)
kono
parents:
diff changeset
14 implicit none
kono
parents:
diff changeset
15 type(data_type), intent(in) :: this
kono
parents:
diff changeset
16 integer, intent(in) :: i
kono
parents:
diff changeset
17 real(kind=sp), dimension(this%nr_cols) :: row
kono
parents:
diff changeset
18 row = this%data(:, i)
kono
parents:
diff changeset
19 end function get_row
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 subroutine print_matrix(m, i, fmt_str)
kono
parents:
diff changeset
22 implicit none
kono
parents:
diff changeset
23 class(data_type), intent(in) :: m
kono
parents:
diff changeset
24 integer, intent(in) :: i
kono
parents:
diff changeset
25 character(len=20), intent(in) :: fmt_str
kono
parents:
diff changeset
26 write (unit=6, fmt=fmt_str) get_row(m, i)
kono
parents:
diff changeset
27 end subroutine print_matrix
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 end module data_func_mod