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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-std=f95" }
3
!
4
! This tests the patch for PR25024.
5
 
6
! PR25024 - The external attribute for subroutine a would cause an ICE.
7
  subroutine A ()
8
    EXTERNAL A  ! { dg-error "EXTERNAL attribute conflicts with SUBROUTINE" }
9
  END
10
 
11
function ext (y)  ! { dg-error "EXTERNAL attribute conflicts with FUNCTION" }
12
  real ext, y
13
  external ext
14
  !ext = y * y
15
end function ext
16
 
17
function ext1 (y)
18
  real ext1, y
19
  external z        ! OK no conflict
20
  ext1 = y * y
21
end function ext1
22
 
23
program main
24
  real ext, inval
25
  external ext       ! OK, valid external reference.
26
  external main      ! { dg-error "PROGRAM attribute conflicts with EXTERNAL" }
27
  interface
28
    function ext1 (y)
29
      real ext1, y
30
      external ext1
31
    end function ext1  ! { dg-error "Duplicate EXTERNAL attribute" }
32
  end interface
33
  inval = 1.0
34
  print *, ext(inval)
35
  print *, ext1(inval)
36
  print *, inv(inval)
37
contains
38
  function inv (y)  ! { dg-error "EXTERNAL attribute conflicts with FUNCTION" }
39
    real inv, y
40
    external inv
41
    !inv = y * y * y
42
  end function inv
43
end program main
44
 

powered by: WebSVN 2.1.0

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