2 ! { dg-options "-fdec-structure" }
6 ! Verify that structure variables with UNION components
7 ! are accepted in an I/O-list READ.
14 character(16) :: c16_1
17 character(16) :: c16_2
23 character(32) :: instr
= "ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^"
27 ! The record r shall be treated as if its components are listed:
28 ! read(...) r.c16_1, r.c16_2
29 ! This shall correspond to the formatted read of A16,A16
30 read(instr
, '(A16,A16)') r
32 ! r.c16_1 and r.c16_2 are in a union, thus share the same memory
33 ! and the first 16 bytes of instr are overwritten
34 if ( r
.c16_1
.ne
. instr(17:32) .or
. r
.c16_2
.ne
. instr(17:32) ) then