PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_union_3.f90
blob9f1dfd31f740e6977aa7b5d48f8b425fe9f5fd6a
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
4 ! Test UNIONs with initializations.
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 STOP 1
11 end subroutine
13 ! Initialization expressions
14 structure /s3/
15 integer(4) :: i = 8
16 union ! U7
17 map
18 integer(4) :: x = 1600
19 integer(4) :: y = 1800
20 end map
21 map
22 integer(2) a, b, c
23 end map
24 end union
25 end structure
27 record /s3/ r3
29 ! Initialized unions
30 if ( r3.x .ne. 1600 .or. r3.y .ne. 1800) then
31 r3.x = r3.y ! If r3 isn't used the initializations are optimized out
32 call aborts ("union initialization")
33 endif
35 end