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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [namelist_12.f] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
c{ dg-do run }
2
c This program repeats many of the same tests as test_nml_1 but for integer
3
c instead of real. It also tests repeat nulls, comma delimited character read,
4
c a triplet qualifier, a range with an assumed start, a quote delimited string,
5
c a qualifier with an assumed end and a fully explicit range.  It also tests
6
c that integers and characters are successfully read back by namelist.
7
c Provided by Paul Thomas - pault@gcc.gnu.org
8
 
9
      program namelist_12
10
 
11
      integer x(10)
12
      integer(kind=8) xx
13
      integer ier
14
      character*10 ch , check
15
      namelist /mynml/ x, xx, ch
16
 
17
c set debug = 0 or 1 in the namelist! (line 33)
18
 
19
      do i = 1 , 10
20
        x(i) = -1
21
      end do
22
      x(6) = 6
23
      x(10) = 10
24
      xx = 0
25
      ch ="zzzzzzzzzz"
26
      check="abcdefghij"
27
 
28
      open (10,status="scratch", delim="apostrophe")
29
      write (10, '(a)') "!mynml"
30
      write (10, '(a)') " "
31
      write (10, '(a)') "&mynml  x(7) =+99 x=1, 2 ,"
32
      write (10, '(a)') " 2*3, ,, 2* !comment"
33
      write (10, '(a)') " 9 ch='qqqdefghqq' , x(8:7:-1) = 8 , 7"
34
      write (10, '(a)') " ch(:3) =""abc"","
35
      write (10, '(a)') " ch(9:)='ij' x(4:5)=4 ,5 xx = 42/"
36
      rewind (10)
37
 
38
      read (10, nml=mynml, IOSTAT=ier)
39
      if (ier.ne.0) call abort
40
      rewind (10)
41
 
42
      write (10, nml=mynml, iostat=ier)
43
      if (ier.ne.0) call abort
44
      rewind (10)
45
 
46
      read (10, NML=mynml, IOSTAT=ier)
47
      if (ier.ne.0) call abort
48
      close (10)
49
 
50
      do i = 1 , 10
51
        if ( abs( x(i) - i ) .ne. 0 ) call abort ()
52
        if ( ch(i:i).ne.check(I:I) ) call abort
53
      end do
54
      if (xx.ne.42) call abort ()
55
      end program

powered by: WebSVN 2.1.0

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