annotate gcc/testsuite/gfortran.dg/achar_4.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-options "-fbounds-check" }
kono
parents:
diff changeset
3 ! Tests the fix for PR31257, in which achar caused an ICE because it had no
kono
parents:
diff changeset
4 ! charlen.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! The code comes from http://www.star.le.ac.uk/~cgp/fortran.html (by Clive Page)
kono
parents:
diff changeset
7 ! Reported by Thomas Koenig <tkoenig@gcc.gnu.org>
kono
parents:
diff changeset
8 !
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 if (any (Up ("AbCdEfGhIjKlM") .ne. (/"ABCDEFGHIJKLM"/))) STOP 1
111
kono
parents:
diff changeset
10 contains
kono
parents:
diff changeset
11 Character (len=20) Function Up (string)
kono
parents:
diff changeset
12 Character(len=*) string
kono
parents:
diff changeset
13 Up = &
kono
parents:
diff changeset
14 transfer(merge(achar(iachar(transfer(string,"x",len(string)))- &
kono
parents:
diff changeset
15 (ichar('a')-ichar('A')) ), &
kono
parents:
diff changeset
16 transfer(string,"x",len(string)) , &
kono
parents:
diff changeset
17 transfer(string,"x",len(string)) >= "a" .and. &
kono
parents:
diff changeset
18 transfer(string,"x",len(string)) <= "z"), repeat("x", len(string)))
kono
parents:
diff changeset
19 return
kono
parents:
diff changeset
20 end function Up
kono
parents:
diff changeset
21 end