2010-11-27 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / transfer_simplify_10.f90
blob3a56e65a6cc25b7c03d0dae1d21fb2078decf06d
1 ! { dg-do run }
3 ! PR fortran/46638
5 ! Contributed by James Van Buskirk
7 program test5
8 use ISO_C_BINDING
9 implicit none
10 type, bind(C) :: CPUID_type
11 integer(C_INT32_T) eax
12 integer(C_INT32_T) ebx
13 integer(C_INT32_T) edx
14 integer(C_INT32_T) ecx
15 integer(C_INT32_T) bbb
16 end type CPUID_type
17 type(CPUID_TYPE) result
18 result = transfer(achar(10)//achar(0)//achar(0)//achar(0)//'GenuineIntel'//'abcd',result)
20 if(( int(z'0000000A') /= result%eax &
21 .or. int(z'756E6547') /= result%ebx &
22 .or. int(z'49656E69') /= result%edx &
23 .or. int(z'6C65746E') /= result%ecx &
24 .or. int(z'64636261') /= result%bbb) &
25 .and. & ! Big endian
26 ( int(z'0A000000') /= result%eax &
27 .or. int(z'47656E75') /= result%ebx &
28 .or. int(z'696E6549') /= result%edx &
29 .or. int(z'6E74656C') /= result%ecx &
30 .or. int(z'61626364') /= result%bbb)) then
31 write(*,'(5(z8.8:1x))') result
32 call abort()
33 end if
34 end program test5