1! { dg-do run }
2! Test Hollerith constants assigned to allocatable array
3! and used in I/O list.
4
5integer, allocatable :: c (:,:)
6character (len = 20) ch
7allocate (c(1,2))
8
9c(1,1) = 4H(A4)
10c(1,2) = 4H(A5)
11
12write (ch, "(2A4)") c
13if (ch .ne. "(A4)(A5)") call abort()
14write (ch, c) 'Hello'
15if (ch .ne. "Hell") call abort()
16write (ch, c (1,2)) 'Hello'
17if (ch .ne. "Hello") call abort()
18
19write (ch, *) 5Hhello
20if (ch .ne. " hello") call abort()
21write (ch, "(A5)") 5Hhello
22if (ch .ne. "hello") call abort()
23
24end
25
26! { dg-warning "Hollerith constant" "const" { target *-*-* } 9 }
27! { dg-warning "Conversion" "conversion" { target *-*-* } 9 }
28
29! { dg-warning "Hollerith constant" "const" { target *-*-* } 10 }
30! { dg-warning "Conversion" "conversion" { target *-*-* } 10 }
31
32! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 14 }
33
34! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 16 }
35
36! { dg-warning "Hollerith constant" "const" { target *-*-* } 19 }
37! { dg-warning "Hollerith constant" "const" { target *-*-* } 21 }
38
39