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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [namelist_23.f90] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
!{ dg-do run }
2
! PR26136 Filling logical variables from namelist read when object list is not
3
! complete.  Test case derived from PR.
4
! Contributed by Jerry DeLisle  
5
program read_logical
6
   implicit none
7
   logical, dimension(4) :: truely
8
   integer, dimension(4) :: truely_a_very_long_variable_name
9
   namelist /mynml/ truely
10
   namelist /mynml/ truely_a_very_long_variable_name
11
 
12
   truely = .false.
13
   truely_a_very_long_variable_name = 0
14
 
15
   open(10, status="scratch")
16
   write(10,*) "&mynml"
17
   write(10,*) "truely       = trouble,    traffic .true"
18
   write(10,*) "truely_a_very_long_variable_name  = 4,      4,      4"
19
   write(10,*) "/"
20
   rewind(10)
21
   read (10, nml=mynml, err = 1000)
22
   if (.not.all(truely(1:3))) call abort()
23
   if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
24
 
25
   truely = .false.
26
   truely_a_very_long_variable_name = 0
27
 
28
   rewind(10)
29
   write(10,*) "&mynml"
30
   write(10,*) "truely       = .true., .true.,"
31
   write(10,*) "truely_a_very_long_variable_name  = 4,      4,      4"
32
   write(10,*) "/"
33
   rewind(10)
34
   read (10, nml=mynml, err = 1000)
35
   if (.not.all(truely(1:2))) call abort()
36
   if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
37
 
38
   truely = .true.
39
   truely_a_very_long_variable_name = 0
40
 
41
   rewind(10)
42
   write(10,*) "&mynml"
43
   write(10,*) "truely       = .false., .false.,"
44
   write(10,*) "truely_a_very_long_variable_name  = 4,      4,      4"
45
   write(10,*) "/"
46
   rewind(10)
47
   read (10, nml=mynml, err = 1000)
48
   if (all(truely(1:2))) call abort()
49
   if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
50
   close(10)
51
   stop
52
1000 call abort()
53
end program read_logical

powered by: WebSVN 2.1.0

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