re PR middle-end/20030 (Broken arguments access)
authorAndrew Pinski <pinskia@physics.uc.edu>
Fri, 18 Feb 2005 14:36:54 +0000 (14:36 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 18 Feb 2005 14:36:54 +0000 (06:36 -0800)
2004-02-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/20030
        * gfortran.fortran-torture/execute/character_passing.f90: New test.

From-SVN: r95227

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/execute/character_passing.f90 [new file with mode: 0644]

index 7d653eca38b69a325cf6b4536422d52ca1d905d0..581e21a9028b92220318bfb2810799bfbf17cbf0 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-18  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/20030
+       * gfortran.fortran-torture/execute/character_passing.f90: New test.
+
 2005-02-18  Alexandre Oliva  <aoliva@redhat.com>
 
        PR c++/20008
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/character_passing.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/character_passing.f90
new file mode 100644 (file)
index 0000000..ade7f9d
--- /dev/null
@@ -0,0 +1,21 @@
+! PR middle-end/20030
+! we were messing up the access in LSAME for
+! the character agruments.
+      program foo
+      character*1 a1, a2, b
+      a1='A'
+      a2='A'
+      b='B'
+      x = LSAME(a1,a2)
+      if ( x.ne.1 ) then
+        call abort  ();
+      endif
+      end
+
+      logical function LSAME( CA, CB )
+      character CA, CB
+      integer   INTA, INTB
+      INTA = ICHAR( CA )
+      INTB = ICHAR( CB )
+      LSAME = INTA.EQ.INTB
+      end