2 ! { dg-options "-fdump-tree-original" }
6 character(len
=10,kind
=1) string1
7 character(len
=10,kind
=4) string4
11 if(index(string1
,1_
'A') /= 1) call abort()
12 if(index(string4
,4_
'A') /= 1) call abort()
13 if(index(string1
,1_
'A',kind
=4) /= 1_4) call abort()
14 if(index(string4
,4_
'A',kind
=4) /= 1_4) call abort()
15 if(index(string1
,1_
'A',kind
=1) /= 1_1) call abort()
16 if(index(string4
,4_
'A',kind
=1) /= 1_1) call abort()
18 if(index(string1
,1_
'A',back
=.true
.) /= 10) call abort()
19 if(index(string4
,4_
'A',back
=.true
.) /= 10) call abort()
20 if(index(string1
,1_
'A',kind
=4,back
=.true
.) /= 10_4) call abort()
21 if(index(string4
,4_
'A',kind
=4,back
=.true
.) /= 10_4) call abort()
22 if(index(string1
,1_
'A',kind
=1,back
=.true
.) /= 10_1) call abort()
23 if(index(string4
,4_
'A',kind
=1,back
=.true
.) /= 10_1) call abort()
25 if(index(string1
,1_
'A',back
=.false
.) /= 1) call abort()
26 if(index(string4
,4_
'A',back
=.false
.) /= 1) call abort()
27 if(index(string1
,1_
'A',kind
=4,back
=.false
.) /= 1_4) call abort()
28 if(index(string4
,4_
'A',kind
=4,back
=.false
.) /= 1_4) call abort()
29 if(index(string1
,1_
'A',kind
=1,back
=.false
.) /= 1_1) call abort()
30 if(index(string4
,4_
'A',kind
=1,back
=.false
.) /= 1_1) call abort()
32 if(scan(string1
,1_
'A') /= 1) call abort()
33 if(scan(string4
,4_
'A') /= 1) call abort()
34 if(scan(string1
,1_
'A',kind
=4) /= 1_4) call abort()
35 if(scan(string4
,4_
'A',kind
=4) /= 1_4) call abort()
36 if(scan(string1
,1_
'A',kind
=1) /= 1_1) call abort()
37 if(scan(string4
,4_
'A',kind
=1) /= 1_1) call abort()
39 if(scan(string1
,1_
'A',back
=.true
.) /= 10) call abort()
40 if(scan(string4
,4_
'A',back
=.true
.) /= 10) call abort()
41 if(scan(string1
,1_
'A',kind
=4,back
=.true
.) /= 10_4) call abort()
42 if(scan(string4
,4_
'A',kind
=4,back
=.true
.) /= 10_4) call abort()
43 if(scan(string1
,1_
'A',kind
=1,back
=.true
.) /= 10_1) call abort()
44 if(scan(string4
,4_
'A',kind
=1,back
=.true
.) /= 10_1) call abort()
46 if(scan(string1
,1_
'A',back
=.false
.) /= 1) call abort()
47 if(scan(string4
,4_
'A',back
=.false
.) /= 1) call abort()
48 if(scan(string1
,1_
'A',kind
=4,back
=.false
.) /= 1_4) call abort()
49 if(scan(string4
,4_
'A',kind
=4,back
=.false
.) /= 1_4) call abort()
50 if(scan(string1
,1_
'A',kind
=1,back
=.false
.) /= 1_1) call abort()
51 if(scan(string4
,4_
'A',kind
=1,back
=.false
.) /= 1_1) call abort()
54 ! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_index" 6 "original" } }
55 ! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_scan" 6 "original" } }
56 ! { dg-final { cleanup-tree-dump "original" } }