1 |
694 |
jeremybenn |
! { dg-do run }
|
2 |
|
|
! { dg-options "-fbackslash" }
|
3 |
|
|
|
4 |
|
|
character(kind=1, len=10) :: s1, t1
|
5 |
|
|
character(kind=4, len=10) :: s4, t4
|
6 |
|
|
|
7 |
|
|
call check1("foobargeefoobargee", "arg", &
|
8 |
|
|
[ index ("foobargeefoobargee", "arg", .true.), &
|
9 |
|
|
index ("foobargeefoobargee", "arg", .false.), &
|
10 |
|
|
scan ("foobargeefoobargee", "arg", .true.), &
|
11 |
|
|
scan ("foobargeefoobargee", "arg", .false.), &
|
12 |
|
|
verify ("foobargeefoobargee", "arg", .true.), &
|
13 |
|
|
verify ("foobargeefoobargee", "arg", .false.) ], &
|
14 |
|
|
4_"foobargeefoobargee", 4_"arg", &
|
15 |
|
|
[ index (4_"foobargeefoobargee", 4_"arg", .true.), &
|
16 |
|
|
index (4_"foobargeefoobargee", 4_"arg", .false.), &
|
17 |
|
|
scan (4_"foobargeefoobargee", 4_"arg", .true.), &
|
18 |
|
|
scan (4_"foobargeefoobargee", 4_"arg", .false.), &
|
19 |
|
|
verify (4_"foobargeefoobargee", 4_"arg", .true.), &
|
20 |
|
|
verify (4_"foobargeefoobargee", 4_"arg", .false.) ])
|
21 |
|
|
|
22 |
|
|
call check1("foobargeefoobargee", "", &
|
23 |
|
|
[ index ("foobargeefoobargee", "", .true.), &
|
24 |
|
|
index ("foobargeefoobargee", "", .false.), &
|
25 |
|
|
scan ("foobargeefoobargee", "", .true.), &
|
26 |
|
|
scan ("foobargeefoobargee", "", .false.), &
|
27 |
|
|
verify ("foobargeefoobargee", "", .true.), &
|
28 |
|
|
verify ("foobargeefoobargee", "", .false.) ], &
|
29 |
|
|
4_"foobargeefoobargee", 4_"", &
|
30 |
|
|
[ index (4_"foobargeefoobargee", 4_"", .true.), &
|
31 |
|
|
index (4_"foobargeefoobargee", 4_"", .false.), &
|
32 |
|
|
scan (4_"foobargeefoobargee", 4_"", .true.), &
|
33 |
|
|
scan (4_"foobargeefoobargee", 4_"", .false.), &
|
34 |
|
|
verify (4_"foobargeefoobargee", 4_"", .true.), &
|
35 |
|
|
verify (4_"foobargeefoobargee", 4_"", .false.) ])
|
36 |
|
|
call check1("foobargeefoobargee", "klm", &
|
37 |
|
|
[ index ("foobargeefoobargee", "klm", .true.), &
|
38 |
|
|
index ("foobargeefoobargee", "klm", .false.), &
|
39 |
|
|
scan ("foobargeefoobargee", "klm", .true.), &
|
40 |
|
|
scan ("foobargeefoobargee", "klm", .false.), &
|
41 |
|
|
verify ("foobargeefoobargee", "klm", .true.), &
|
42 |
|
|
verify ("foobargeefoobargee", "klm", .false.) ], &
|
43 |
|
|
4_"foobargeefoobargee", 4_"klm", &
|
44 |
|
|
[ index (4_"foobargeefoobargee", 4_"klm", .true.), &
|
45 |
|
|
index (4_"foobargeefoobargee", 4_"klm", .false.), &
|
46 |
|
|
scan (4_"foobargeefoobargee", 4_"klm", .true.), &
|
47 |
|
|
scan (4_"foobargeefoobargee", 4_"klm", .false.), &
|
48 |
|
|
verify (4_"foobargeefoobargee", 4_"klm", .true.), &
|
49 |
|
|
verify (4_"foobargeefoobargee", 4_"klm", .false.) ])
|
50 |
|
|
call check1("foobargeefoobargee", "gee", &
|
51 |
|
|
[ index ("foobargeefoobargee", "gee", .true.), &
|
52 |
|
|
index ("foobargeefoobargee", "gee", .false.), &
|
53 |
|
|
scan ("foobargeefoobargee", "gee", .true.), &
|
54 |
|
|
scan ("foobargeefoobargee", "gee", .false.), &
|
55 |
|
|
verify ("foobargeefoobargee", "gee", .true.), &
|
56 |
|
|
verify ("foobargeefoobargee", "gee", .false.) ], &
|
57 |
|
|
4_"foobargeefoobargee", 4_"gee", &
|
58 |
|
|
[ index (4_"foobargeefoobargee", 4_"gee", .true.), &
|
59 |
|
|
index (4_"foobargeefoobargee", 4_"gee", .false.), &
|
60 |
|
|
scan (4_"foobargeefoobargee", 4_"gee", .true.), &
|
61 |
|
|
scan (4_"foobargeefoobargee", 4_"gee", .false.), &
|
62 |
|
|
verify (4_"foobargeefoobargee", 4_"gee", .true.), &
|
63 |
|
|
verify (4_"foobargeefoobargee", 4_"gee", .false.) ])
|
64 |
|
|
call check1("foobargeefoobargee", "foo", &
|
65 |
|
|
[ index ("foobargeefoobargee", "foo", .true.), &
|
66 |
|
|
index ("foobargeefoobargee", "foo", .false.), &
|
67 |
|
|
scan ("foobargeefoobargee", "foo", .true.), &
|
68 |
|
|
scan ("foobargeefoobargee", "foo", .false.), &
|
69 |
|
|
verify ("foobargeefoobargee", "foo", .true.), &
|
70 |
|
|
verify ("foobargeefoobargee", "foo", .false.) ], &
|
71 |
|
|
4_"foobargeefoobargee", 4_"foo", &
|
72 |
|
|
[ index (4_"foobargeefoobargee", 4_"foo", .true.), &
|
73 |
|
|
index (4_"foobargeefoobargee", 4_"foo", .false.), &
|
74 |
|
|
scan (4_"foobargeefoobargee", 4_"foo", .true.), &
|
75 |
|
|
scan (4_"foobargeefoobargee", 4_"foo", .false.), &
|
76 |
|
|
verify (4_"foobargeefoobargee", 4_"foo", .true.), &
|
77 |
|
|
verify (4_"foobargeefoobargee", 4_"foo", .false.) ])
|
78 |
|
|
|
79 |
|
|
call check1(" \b fe \b\0 bar cad", " \b\0", &
|
80 |
|
|
[ index (" \b fe \b\0 bar cad", " \b\0", .true.), &
|
81 |
|
|
index (" \b fe \b\0 bar cad", " \b\0", .false.), &
|
82 |
|
|
scan (" \b fe \b\0 bar cad", " \b\0", .true.), &
|
83 |
|
|
scan (" \b fe \b\0 bar cad", " \b\0", .false.), &
|
84 |
|
|
verify (" \b fe \b\0 bar cad", " \b\0", .true.), &
|
85 |
|
|
verify (" \b fe \b\0 bar cad", " \b\0", .false.) ], &
|
86 |
|
|
4_" \uC096 fe \uC096\uB8DE bar cad", 4_" \uC096\uB8DE", &
|
87 |
|
|
[ index (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
88 |
|
|
4_" \uC096\uB8DE", .true.), &
|
89 |
|
|
index (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
90 |
|
|
4_" \uC096\uB8DE", .false.), &
|
91 |
|
|
scan (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
92 |
|
|
4_" \uC096\uB8DE", .true.), &
|
93 |
|
|
scan (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
94 |
|
|
4_" \uC096\uB8DE", .false.), &
|
95 |
|
|
verify (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
96 |
|
|
4_" \uC096\uB8DE", .true.), &
|
97 |
|
|
verify (4_" \uC096 fe \uC096\uB8DE bar cad", &
|
98 |
|
|
4_" \uC096\uB8DE", .false.) ])
|
99 |
|
|
|
100 |
|
|
contains
|
101 |
|
|
|
102 |
|
|
subroutine check1 (s1, t1, res1, s4, t4, res4)
|
103 |
|
|
character(kind=1, len=*) :: s1, t1
|
104 |
|
|
character(kind=4, len=*) :: s4, t4
|
105 |
|
|
integer :: res1(6), res4(6)
|
106 |
|
|
|
107 |
|
|
if (any (res1 /= res4)) call abort
|
108 |
|
|
|
109 |
|
|
if (index (s1, t1, .true.) /= res1(1)) call abort
|
110 |
|
|
if (index (s1, t1, .false.) /= res1(2)) call abort
|
111 |
|
|
if (scan (s1, t1, .true.) /= res1(3)) call abort
|
112 |
|
|
if (scan (s1, t1, .false.) /= res1(4)) call abort
|
113 |
|
|
if (verify (s1, t1, .true.) /= res1(5)) call abort
|
114 |
|
|
if (verify (s1, t1, .false.) /= res1(6)) call abort
|
115 |
|
|
|
116 |
|
|
if (index (s4, t4, .true.) /= res4(1)) call abort
|
117 |
|
|
if (index (s4, t4, .false.) /= res4(2)) call abort
|
118 |
|
|
if (scan (s4, t4, .true.) /= res4(3)) call abort
|
119 |
|
|
if (scan (s4, t4, .false.) /= res4(4)) call abort
|
120 |
|
|
if (verify (s4, t4, .true.) /= res4(5)) call abort
|
121 |
|
|
if (verify (s4, t4, .false.) /= res4(6)) call abort
|
122 |
|
|
|
123 |
|
|
end subroutine check1
|
124 |
|
|
|
125 |
|
|
end
|