OSDN Git Service

2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / hollerith6.f90
1 ! PR fortran/39865
2 ! { dg-do run }
3
4 subroutine foo (a)
5   integer(kind=4) :: a(1, 3)
6   character(len=40) :: t
7   write (t, fmt=a(1,2)) 1, 2, 3, 4, 5, 6, 7, 8
8   if (t .ne. '   1   2   3   4   5   6   7   8') call abort
9 end subroutine foo
10   interface
11     subroutine foo (a)
12       integer(kind=4) :: a(1, 3)
13     end subroutine foo
14   end interface
15   integer(kind=4) :: b(1,3)
16   character(len=40) :: t
17   b(1,1) = 4HXXXX
18   b(1,2) = 4H (8I
19   b(1,3) = 2H4)
20   write (t, fmt=b(1,2)) 1, 2, 3, 4, 5, 6, 7, 8
21   if (t .ne. '   1   2   3   4   5   6   7   8') call abort
22   call foo (b)
23 end
24
25 ! { dg-warning "Non-character in FORMAT tag" "FMT" { target *-*-* } 7 }
26 ! { dg-warning "Non-character in FORMAT tag" "FMT" { target *-*-* } 20 }
27
28 ! { dg-warning "Hollerith constant" "const" { target *-*-* } 17 }
29 ! { dg-warning "Conversion" "conversion" { target *-*-* } 17 }
30
31 ! { dg-warning "Hollerith constant" "const" { target *-*-* } 18 }
32 ! { dg-warning "Conversion" "conversion" { target *-*-* } 18 }
33
34 ! { dg-warning "Hollerith constant" "const" { target *-*-* } 19 }
35 ! { dg-warning "Conversion" "conversion" { target *-*-* } 19 }