* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr35983.f90
blob5cc3855029427f60970e47ba58a71871f6a9b66e
1 ! { dg-do run }
3 ! PR fortran/35983
4 ! C_LOC expanded to a NULL_PTR expr if called from a structure constructor
6 ! Contributed by François-Xavier Coudert
8 program main
9 use ISO_C_BINDING
10 implicit none
11 type, bind(C) :: descr
12 type(C_PTR) :: address
13 end type descr
14 type(descr) :: DD
15 double precision, target :: buf(1)
16 integer (C_INTPTR_T) :: i, j
18 buf = (/ 0 /)
19 DD = descr(c_loc(buf))
20 i = transfer (DD%address, 0_c_intptr_t)
21 j = transfer (c_loc(buf), 0_c_intptr_t)
22 if (any((/ i,j /) == 0_c_intptr_t)) call abort
23 if (i /= j) call abort
24 end program main