diff options
author | Thomas Koenig <Thomas.Koenig@online.de> | 2007-01-21 20:51:53 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2007-01-21 20:51:53 +0000 |
commit | bd9431157f40688ff519cc600b66990248f3b068 (patch) | |
tree | da0f261c2091d8c049c3b6d2fe7280f6763ef07e /gcc | |
parent | 7fa49e7be7cf815dd55f9ef2ead04ee002d687a8 (diff) | |
download | gcc-bd9431157f40688ff519cc600b66990248f3b068.zip gcc-bd9431157f40688ff519cc600b66990248f3b068.tar.gz gcc-bd9431157f40688ff519cc600b66990248f3b068.tar.bz2 |
re PR libfortran/30525 ([4.2, 4.1 only] character comparisons with padding)
2007-01-21 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30525
* intrinsics/string_intrinsics.c(compare_string): Make
sure that comparisons are done unsigned.
2007-01-21 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30525
* gfortran.dg/char_comparison_1.f: New test.
From-SVN: r121035
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/char_comparison_1.f | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d248286..e92e40b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-01-21 Thomas Koenig <Thomas.Koenig@online.de> + + PR libfortran/30525 + * gfortran.dg/char_comparison_1.f: New test. + 2007-01-21 Ira Rosen <irar@il.ibm.com> * gcc.dg/vect/vect-strided-same-dr.c: New test. diff --git a/gcc/testsuite/gfortran.dg/char_comparison_1.f b/gcc/testsuite/gfortran.dg/char_comparison_1.f new file mode 100644 index 0000000..9a316b7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/char_comparison_1.f @@ -0,0 +1,26 @@ +C { dg-do run } +C PR 30525 - comparisons with padded spaces were done +C signed. + program main + character*2 c2 + character*1 c1, c3, c4 +C +C Comparison between char(255) and space padding +C + c2 = 'a' // char(255) + c1 = 'a' + if (.not. (c2 .gt. c1)) call abort +C +C Comparison between char(255) and space +C + c3 = ' ' + c4 = char(255) + if (.not. (c4 .gt. c3)) call abort + +C +C Check constant folding +C + if (.not. ('a' // char(255) .gt. 'a')) call abort + + if (.not. (char(255) .gt. 'a')) call abort + end |