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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR39630: Fortran 2003: Procedure pointer components.
4
!
5
! Probing some error messages.
6
!
7
! Contributed by Janus Weil 
8
 
9
implicit none
10
 
11
interface
12
 subroutine sub
13
 end subroutine
14
end interface
15
 
16
external :: aaargh
17
 
18
type :: t
19
  procedure(), pointer, nopass :: ptr1
20
  procedure(real), pointer, nopass :: ptr2
21
  procedure(sub), pointer, nopass :: ptr3
22
  procedure(), pointer, nopass ptr4              ! { dg-error "Expected '::'" }
23
  procedure(), pointer, nopass, pointer :: ptr5  ! { dg-error "Duplicate" }
24
  procedure, pointer, nopass :: ptr6             ! { dg-error "Syntax error" }
25
  procedure(), nopass :: ptr8                    ! { dg-error "POINTER attribute is required" }
26
  procedure(pp), pointer, nopass :: ptr9         ! { dg-error "declared in a later PROCEDURE statement" }
27
  procedure(aaargh), pointer, nopass :: ptr10    ! { dg-error "must be explicit" }
28
  real :: y
29
end type t
30
 
31
type,bind(c) :: bct                   ! { dg-error "BIND.C. derived type" }
32
  procedure(), pointer,nopass :: ptr  ! { dg-error "cannot be a member of|may not be C interoperable" }
33
end type bct
34
 
35
procedure(sub), pointer :: pp
36
 
37
type(t) :: x
38
 
39
x%ptr2 => x       ! { dg-error "Invalid procedure pointer assignment" }
40
 
41
x => x%ptr2       ! { dg-error "Non-POINTER in pointer association context" }
42
 
43
print *, x%ptr1() ! { dg-error "attribute conflicts with" }
44
call x%ptr2()     ! { dg-error "attribute conflicts with" }
45
print *,x%ptr3()  ! { dg-error "attribute conflicts with" }
46
 
47
call x%y          ! { dg-error "Expected type-bound procedure or procedure pointer component" }
48
 
49
end
50
 

powered by: WebSVN 2.1.0

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