annotate gcc/testsuite/gfortran.dg/pr67805.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 compile }
kono
parents:
diff changeset
2 ! PR fortran/67805
kono
parents:
diff changeset
3 ! Original code contributed by Gerhard Steinmetz
kono
parents:
diff changeset
4 ! gerhard dot steinmetz dot fortran at t-online dot de
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 subroutine p
kono
parents:
diff changeset
7 integer, parameter :: n = 1
kono
parents:
diff changeset
8 integer, parameter :: m(3) = [1, 2, 3]
kono
parents:
diff changeset
9 character(len=1) s(2)
kono
parents:
diff changeset
10 s = [character((m(1))) :: 'x', 'y'] ! OK.
kono
parents:
diff changeset
11 s = [character(m(1)) :: 'x', 'y'] ! OK.
kono
parents:
diff changeset
12 s = [character(m) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 ! The next line should case an error, but causes an ICE.
kono
parents:
diff changeset
15 s = [character(m(2:3)) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 call foo(s)
kono
parents:
diff changeset
18 s = [character('') :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
19 s = [character(['']) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
20 s = [character([.true.]) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
21 s = [character([.false.]) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
22 s = [character([1.]) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
23 s = [character([1d1]) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
24 s = [character([(0.,1.)]) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
25 s = [character(null()) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
26 call foo(s)
kono
parents:
diff changeset
27 end subroutine p
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 subroutine q
kono
parents:
diff changeset
30 print *, '1: ', [character(.true.) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
31 print *, '2: ', [character(.false.) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
32 print *, '3: ', [character(1.) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
33 print *, '4: ', [character(1d1) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
34 print *, '5: ', [character((0.,1.)) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }
kono
parents:
diff changeset
35 print *, '6: ', [character(null()) :: 'x', 'y'] ! { dg-error "INTEGER expression expected" }.
kono
parents:
diff changeset
36 end subroutine q