OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pr35983.f90] - Blame information for rev 708

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
!
3
! PR fortran/35983
4
! C_LOC expanded to a NULL_PTR expr if called from a structure constructor
5
!
6
! Contributed by François-Xavier Coudert
7
 
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
17
 
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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.