nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / function_optimize_10.f90
blob6d8a87a1fa309e7bb6cfdea94d4a26e6ca2daa0c
1 ! { dg-do run }
2 ! PR 51858 - this used to generate wrong code.
3 ! Original test case by Don Simons.
5 program main
6 implicit none
7 logical :: test1_ok
8 logical :: test2_ok
9 logical :: test3_ok
10 character(len=1):: charq
12 charq = 'c'
14 test1_ok = .true.
15 test2_ok = .false.
16 if (charq .eq. ' ') then
17 test1_ok = .false.
18 else if ((my_ichar(charq).ge.97 .and. my_ichar(charq).le.103)) then
19 test2_OK = .true.
20 end if
21 if ((.not. test1_ok) .or. (.not. test2_ok)) STOP 1
23 test1_ok = .true.
24 test2_ok = .true.
25 test3_ok = .false.
27 if (charq .eq. ' ') then
28 test1_ok = .false.
29 else if ((my_ichar(charq).lt.97 .or. my_ichar(charq).gt.103)) then
30 test2_ok = .false.
31 else if ((my_ichar(charq).ge.97 .and. my_ichar(charq).le.103)) then
32 test3_ok = .true.
33 end if
34 if ((.not. test1_ok) .or. (.not. test2_ok) .or. (.not. test3_ok)) STOP 2
36 test1_ok = .true.
37 test2_ok = .true.
38 test3_ok = .false.
40 if (charq .eq. ' ') then
41 test1_ok = .false.
42 else if ((my_ichar(charq).lt.97 .or. my_ichar(charq).gt.103)) then
43 test2_ok = .false.
44 else
45 test3_ok = .true.
46 end if
48 if ((.not. test1_ok) .or. (.not. test2_ok) .or. (.not. test3_ok)) STOP 3
50 contains
51 pure function my_ichar(c)
52 integer :: my_ichar
53 character(len=1), intent(in) :: c
54 my_ichar = ichar(c)
55 end function my_ichar
56 end program main