2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / select_char_2.f90
blobbcdc94a886147182b8acf7bbb074d653d3360ad9
1 ! { dg-do run }
2 ! { dg-options "-O -fdump-tree-original" }
4 if (foo ('E') .ne. 1) call abort
5 if (foo ('e') .ne. 1) call abort
6 if (foo ('f') .ne. 2) call abort
7 if (foo ('g') .ne. 2) call abort
8 if (foo ('h') .ne. 2) call abort
9 if (foo ('Q') .ne. 3) call abort
10 if (foo (' ') .ne. 4) call abort
11 if (bar ('e') .ne. 1) call abort
12 if (bar ('f') .ne. 3) call abort
13 contains
14 function foo (c)
15 character :: c
16 integer :: foo
17 select case (c)
18 case ('E','e')
19 foo = 1
20 case ('f':'h ')
21 foo = 2
22 case default
23 foo = 3
24 case ('')
25 foo = 4
26 end select
27 end function
28 function bar (c)
29 character :: c
30 integer :: bar
31 select case (c)
32 case ('ea':'ez')
33 bar = 2
34 case ('e')
35 bar = 1
36 case default
37 bar = 3
38 case ('fd')
39 bar = 4
40 end select
41 end function
42 end
44 ! { dg-final { scan-tree-dump-not "_gfortran_select_string" "original" } }