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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [argument_checking_2.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
! PR fortran/30940
5
program main
6
  implicit none
7
  character(len=10) :: digit_string = '123456789', str
8
  character :: digit_arr(10)
9
  call copy(digit_string, digit_arr)  ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
10
  call copy(digit_arr,str)            ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
11
  if(str /= '123456789') call abort()
12
  digit_string = 'qwertasdf'
13
  call copy2(digit_string, digit_arr) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
14
  call copy2(digit_arr,str) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
15
  if(str /= 'qwertasdf') call abort()
16
  digit_string = '1qayxsw23e'
17
  call copy('1qayxsw23e', digit_arr) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
18
  call copy(digit_arr,str) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
19
  if(str /= '1qayxsw23e') call abort()
20
contains
21
  subroutine copy(in, out)
22
    character, dimension(*)  :: in
23
    character, dimension(10) :: out
24
    out = in(:10)
25
  end subroutine copy
26
  subroutine copy2(in, out)
27
    character, dimension(2,*)  :: in
28
    character, dimension(2,5) :: out
29
    out(1:2,1:5) = in(1:2,1:5)
30
  end subroutine copy2
31
end program main

powered by: WebSVN 2.1.0

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