annotate gcc/testsuite/gfortran.dg/logical_2.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +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/30799
kono
parents:
diff changeset
3 ! Inconsistent handling of bad (invalid) LOGICAL kinds
kono
parents:
diff changeset
4 ! Reporter: Harald Anlauf <anlauf@gmx.de>
kono
parents:
diff changeset
5 ! Testcase altered by Steven G. Kargl
kono
parents:
diff changeset
6 program gfcbug57
kono
parents:
diff changeset
7 implicit none
kono
parents:
diff changeset
8 !
kono
parents:
diff changeset
9 ! These are logical kinds known by gfortran and many other compilers:
kono
parents:
diff changeset
10 !
kono
parents:
diff changeset
11 print *, kind (.true._1) ! This prints "1"
kono
parents:
diff changeset
12 print *, kind (.true._2) ! This prints "2"
kono
parents:
diff changeset
13 print *, kind (.true._4) ! This prints "4"
kono
parents:
diff changeset
14 print *, kind (.true._8) ! This prints "8"
kono
parents:
diff changeset
15 !
kono
parents:
diff changeset
16 ! These are very strange (read: bad (invalid?)) logical kinds,
kono
parents:
diff changeset
17 ! handled inconsistently by gfortran (there's no logical(kind=0) etc.)
kono
parents:
diff changeset
18 !
kono
parents:
diff changeset
19 print *, kind (.true._0) ! { dg-error "kind for logical constant" }
kono
parents:
diff changeset
20 print *, kind (.true._3) ! { dg-error "kind for logical constant" }
kono
parents:
diff changeset
21 print *, kind (.true._123) ! { dg-error "kind for logical constant" }
kono
parents:
diff changeset
22 !
kono
parents:
diff changeset
23 ! Here gfortran bails out with a runtime error:
kono
parents:
diff changeset
24 !
kono
parents:
diff changeset
25 print *, .true._3 ! { dg-error "kind for logical constant" }
kono
parents:
diff changeset
26 end program gfcbug57