annotate gcc/testsuite/gfortran.dg/char_length_1.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 ! { dg-options "-Wall -std=f2003" }
kono
parents:
diff changeset
3 ! Tests the patch for PR27996 and PR27998, in which warnings
kono
parents:
diff changeset
4 ! or errors were not emitted when the length of character
kono
parents:
diff changeset
5 ! constants was changed silently.
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 ! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
kono
parents:
diff changeset
8 !
kono
parents:
diff changeset
9 program test
kono
parents:
diff changeset
10 implicit none
kono
parents:
diff changeset
11 character(10) :: a(3)
kono
parents:
diff changeset
12 character(10) :: b(3)= &
kono
parents:
diff changeset
13 (/ 'Takata ', 'Tanaka', 'Hayashi' /) ! { dg-error "Different CHARACTER" }
kono
parents:
diff changeset
14 character(4) :: c = "abcde" ! { dg-warning "being truncated" }
kono
parents:
diff changeset
15 a = (/ 'Takata', 'Tanaka ', 'Hayashi' /) ! { dg-error "Different CHARACTER" }
kono
parents:
diff changeset
16 a = (/ 'Takata ', 'Tanaka ', 'Hayashi' /)
kono
parents:
diff changeset
17 b = "abc" ! { dg-error "no IMPLICIT" }
kono
parents:
diff changeset
18 c = "abcdefg" ! { dg-warning "will be truncated" }
kono
parents:
diff changeset
19 end program test