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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Length of character dummy variable with VALUE attribute:
3
! - must be initialization expression or omitted
4
! - C interoperable: must be initialization expression of length one
5
!   or omitted
6
!
7
! Contributed by Tobias Burnus
8
program x
9
  implicit none
10
  character(10) :: c1,c10
11
  c1  = 'H'
12
  c10 = 'Main'
13
  call foo1(c1)
14
  call foo2(c1)
15
  call foo3(c10)
16
  call foo4(c10)
17
  call bar1(c1)
18
  call bar2(c1)
19
  call bar3(c10)
20
  call bar4(c10)
21
 
22
contains
23
 
24
  subroutine foo1(a)
25
    character :: a
26
    value :: a
27
  end subroutine foo1
28
 
29
  subroutine foo2(a)
30
    character(1) :: a
31
    value :: a
32
  end subroutine foo2
33
 
34
  subroutine foo3(a)
35
    character(10) :: a
36
    value :: a
37
  end subroutine foo3
38
 
39
  subroutine foo4(a) ! { dg-error "VALUE attribute must have constant length" }
40
    character(*) :: a
41
    value :: a
42
  end subroutine foo4
43
 
44
  subroutine bar1(a)
45
    use iso_c_binding, only: c_char
46
    character(kind=c_char) :: a
47
    value :: a
48
  end subroutine bar1
49
 
50
  subroutine bar2(a)
51
    use iso_c_binding, only: c_char
52
    !character(kind=c_char,len=1) :: a
53
    character(1,kind=c_char) :: a
54
    value :: a
55
  end subroutine bar2
56
 
57
  subroutine bar3(a) ! { dg-error "VALUE attribute must have length one" }
58
    use iso_c_binding, only: c_char
59
    character(kind=c_char,len=10) :: a
60
    value :: a
61
  end subroutine bar3
62
 
63
  subroutine bar4(a) ! { dg-error "VALUE attribute must have constant length" }
64
    use iso_c_binding, only: c_char
65
    character(kind=c_char,len=*) :: a
66
    value :: a
67
  end subroutine bar4
68
end program x

powered by: WebSVN 2.1.0

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