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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [strarray_3.f90] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
program strarray_3
2
  character(len=5), dimension(2) :: c
3
 
4
  c(1) = "Hello"
5
  c(2) = "World"
6
 
7
  call foo1(c)
8
  call foo2(c, 2)
9
  call foo3(c, 5)
10
  call foo4(c, 5, 2)
11
  call foo5(c(2:1:-1))
12
contains
13
subroutine foo1(a)
14
  implicit none
15
  character(len=5), dimension(2)  :: a
16
 
17
  if ((a(1) .ne. "Hello") .or. (a(2) .ne. "World")) call abort
18
end subroutine
19
 
20
subroutine foo2(a, m)
21
  implicit none
22
  integer  m
23
  character(len=5), dimension(m)  :: a
24
 
25
  if ((a(1) .ne. "Hello") .or. (a(2) .ne. "World")) call abort
26
end subroutine
27
 
28
subroutine foo3(a, n)
29
  implicit none
30
  integer n
31
  character(len=n), dimension(:)  :: a
32
 
33
  if ((a(1) .ne. "Hello") .or. (a(2) .ne. "World")) call abort
34
end subroutine
35
 
36
subroutine foo4(a, n, m)
37
  implicit none
38
  integer n, m
39
  character(len=n), dimension(m)  :: a
40
 
41
  if ((a(1) .ne. "Hello") .or. (a(2) .ne. "World")) call abort
42
end subroutine
43
 
44
subroutine foo5(a)
45
  implicit none
46
  character(len=2), dimension(5)  :: a
47
 
48
  if ((a(1) .ne. "Wo") .or. (a(3) .ne. "dH") .or. (a(5) .ne. "lo")) call abort
49
end subroutine
50
end program

powered by: WebSVN 2.1.0

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