ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / index_2.f90
blobd0e99bd99d4b1612939d3c7e610a49932349f4d6
1 ! { dg-do run }
2 ! { dg-options "-fdump-tree-original" }
3 ! PR fortran/36462
5 implicit none
6 character(len=10,kind=1) string1
7 character(len=10,kind=4) string4
8 string1 = 'ABCDEEDCBA'
9 string4 = 'ABCDEEDCBA'
11 if(index(string1,1_'A') /= 1) STOP 1
12 if(index(string4,4_'A') /= 1) STOP 2
13 if(index(string1,1_'A',kind=4) /= 1_4) STOP 3
14 if(index(string4,4_'A',kind=4) /= 1_4) STOP 4
15 if(index(string1,1_'A',kind=1) /= 1_1) STOP 5
16 if(index(string4,4_'A',kind=1) /= 1_1) STOP 6
18 if(index(string1,1_'A',back=.true.) /= 10) STOP 7
19 if(index(string4,4_'A',back=.true.) /= 10) STOP 8
20 if(index(string1,1_'A',kind=4,back=.true.) /= 10_4) STOP 9
21 if(index(string4,4_'A',kind=4,back=.true.) /= 10_4) STOP 10
22 if(index(string1,1_'A',kind=1,back=.true.) /= 10_1) STOP 11
23 if(index(string4,4_'A',kind=1,back=.true.) /= 10_1) STOP 12
25 if(index(string1,1_'A',back=.false.) /= 1) STOP 13
26 if(index(string4,4_'A',back=.false.) /= 1) STOP 14
27 if(index(string1,1_'A',kind=4,back=.false.) /= 1_4) STOP 15
28 if(index(string4,4_'A',kind=4,back=.false.) /= 1_4) STOP 16
29 if(index(string1,1_'A',kind=1,back=.false.) /= 1_1) STOP 17
30 if(index(string4,4_'A',kind=1,back=.false.) /= 1_1) STOP 18
32 if(scan(string1,1_'A') /= 1) STOP 19
33 if(scan(string4,4_'A') /= 1) STOP 20
34 if(scan(string1,1_'A',kind=4) /= 1_4) STOP 21
35 if(scan(string4,4_'A',kind=4) /= 1_4) STOP 22
36 if(scan(string1,1_'A',kind=1) /= 1_1) STOP 23
37 if(scan(string4,4_'A',kind=1) /= 1_1) STOP 24
39 if(scan(string1,1_'A',back=.true.) /= 10) STOP 25
40 if(scan(string4,4_'A',back=.true.) /= 10) STOP 26
41 if(scan(string1,1_'A',kind=4,back=.true.) /= 10_4) STOP 27
42 if(scan(string4,4_'A',kind=4,back=.true.) /= 10_4) STOP 28
43 if(scan(string1,1_'A',kind=1,back=.true.) /= 10_1) STOP 29
44 if(scan(string4,4_'A',kind=1,back=.true.) /= 10_1) STOP 30
46 if(scan(string1,1_'A',back=.false.) /= 1) STOP 31
47 if(scan(string4,4_'A',back=.false.) /= 1) STOP 32
48 if(scan(string1,1_'A',kind=4,back=.false.) /= 1_4) STOP 33
49 if(scan(string4,4_'A',kind=4,back=.false.) /= 1_4) STOP 34
50 if(scan(string1,1_'A',kind=1,back=.false.) /= 1_1) STOP 35
51 if(scan(string4,4_'A',kind=1,back=.false.) /= 1_1) STOP 36
52 end
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" } }