URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_ptr_tests_16.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do compile }! { dg-options "-fdump-tree-optimized -O" }!! PR fortran/46974program testuse ISO_C_BINDINGimplicit nonetype(c_ptr) :: minteger(c_intptr_t) :: ainteger(transfer(transfer(4_c_intptr_t, c_null_ptr),1_c_intptr_t)) :: ba = transfer (transfer("ABCE", m), 1_c_intptr_t)print '(z8)', aif ( int(z'45434241') /= a &.and. int(z'41424345') /= a &.and. int(z'4142434500000000',kind=8) /= a) &call i_do_not_exist()end program test! Examples contributed by Steve Kargl and James Van Buskirksubroutine bug1use ISO_C_BINDINGimplicit nonetype(c_ptr) :: mtype mytypeinteger a, b, cend type mytypetype(mytype) xprint *, transfer(32512, x) ! Works.print *, transfer(32512, m) ! Caused ICE.end subroutine bug1subroutine bug6use ISO_C_BINDINGimplicit noneinterfacefunction fun()use ISO_C_BINDINGimplicit nonetype(C_FUNPTR) funend function funend interfacetype(C_PTR) array(2)type(C_FUNPTR) resultinteger(C_INTPTR_T), parameter :: const(*) = [32512,32520]result = fun()array = transfer([integer(C_INTPTR_T)::32512,32520],array)! write(*,*) transfer(result,const)! write(*,*) transfer(array,const)end subroutine bug6function fun()use ISO_C_BINDINGimplicit nonetype(C_FUNPTR) funfun = transfer(32512_C_INTPTR_T,fun)end function fun! { dg-final { scan-tree-dump-times "i_do_not_exist" 0 "optimized" } }! { dg-final { cleanup-tree-dump "optimized" } }
