PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / logical_2.f90
blob1a28fefd50cdeac5f4312fac1dd6c5656e52c552
1 ! { dg-do compile }
2 ! PR fortran/30799
3 ! Inconsistent handling of bad (invalid) LOGICAL kinds
4 ! Reporter: Harald Anlauf <anlauf@gmx.de>
5 ! Testcase altered by Steven G. Kargl
6 program gfcbug57
7 implicit none
9 ! These are logical kinds known by gfortran and many other compilers:
11 print *, kind (.true._1) ! This prints "1"
12 print *, kind (.true._2) ! This prints "2"
13 print *, kind (.true._4) ! This prints "4"
14 print *, kind (.true._8) ! This prints "8"
16 ! These are very strange (read: bad (invalid?)) logical kinds,
17 ! handled inconsistently by gfortran (there's no logical(kind=0) etc.)
19 print *, kind (.true._0) ! { dg-error "kind for logical constant" }
20 print *, kind (.true._3) ! { dg-error "kind for logical constant" }
21 print *, kind (.true._123) ! { dg-error "kind for logical constant" }
23 ! Here gfortran bails out with a runtime error:
25 print *, .true._3 ! { dg-error "kind for logical constant" }
26 end program gfcbug57