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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [intrinsic_actual_1.f] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
! { dg-do compile }
! { dg-do compile }
! Tests the fix for PR27554, where the actual argument reference
! Tests the fix for PR27554, where the actual argument reference
! to abs would not be recognised as being to an intrinsic
! to abs would not be recognised as being to an intrinsic
! procedure and would produce junk in the assembler.
! procedure and would produce junk in the assembler.
!
!
! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 
! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 
!
!
      subroutine foo (proc, z)
      subroutine foo (proc, z)
        external proc
        external proc
        real proc, z
        real proc, z
        if ((proc(z) .ne. abs (z)) .and.
        if ((proc(z) .ne. abs (z)) .and.
     &      (proc(z) .ne. alog10 (abs(z)))) call abort ()
     &      (proc(z) .ne. alog10 (abs(z)))) call abort ()
        return
        return
      end
      end
 
 
        external cos
        external cos
        interface
        interface
          function sin (a)
          function sin (a)
            real a, sin
            real a, sin
          end function sin
          end function sin
        end interface
        end interface
 
 
 
 
        intrinsic alog10
        intrinsic alog10
        real x
        real x
        x = 100.
        x = 100.
! The reference here would prevent the actual arg from being seen
! The reference here would prevent the actual arg from being seen
! as an intrinsic procedure in the call to foo.
! as an intrinsic procedure in the call to foo.
        x = -abs(x)
        x = -abs(x)
        call foo(abs, x)
        call foo(abs, x)
! The intrinsic function can be locally over-ridden by an interface
! The intrinsic function can be locally over-ridden by an interface
        call foo(sin, x)
        call foo(sin, x)
! or an external declaration.
! or an external declaration.
        call foo(cos, x)
        call foo(cos, x)
! Just make sure with another intrinsic but this time not referenced.
! Just make sure with another intrinsic but this time not referenced.
        call foo(alog10, -x)
        call foo(alog10, -x)
      end
      end
 
 
      function sin (a)
      function sin (a)
        real a, sin
        real a, sin
        sin = -a
        sin = -a
        return
        return
      end
      end
 
 
      function cos (a)
      function cos (a)
        real a, cos
        real a, cos
        cos = -a
        cos = -a
        return
        return
      end
      end
 
 

powered by: WebSVN 2.1.0

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