From 4fd094835a8997cdcc3d18d7d297debe1527202d Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Wed, 31 Jan 2024 15:44:32 +0000 Subject: PR modula2/111627 Excess test fails with a case-preserving-case-insensitive source tree This patch renames gm2 testsuite modules whose names conflict with library modules. The conflict is not seen on case preserving case sensitive file systems. gcc/testsuite/ChangeLog: PR modula2/111627 * gm2/pim/pass/stdio.mod: Moved to... * gm2/pim/pass/teststdio.mod: ...here. * gm2/pim/run/pass/builtins.mod: Moved to... * gm2/pim/run/pass/testbuiltins.mod: ...here. * gm2/pim/run/pass/math.mod: Moved to... * gm2/pim/run/pass/testmath.mod: ...here. * gm2/pim/run/pass/math2.mod: Moved to... * gm2/pim/run/pass/testmath2.mod: ...here. Signed-off-by: Gaius Mulley --- gcc/testsuite/gm2/pim/pass/stdio.mod | 53 ----------------- gcc/testsuite/gm2/pim/pass/teststdio.mod | 53 +++++++++++++++++ gcc/testsuite/gm2/pim/run/pass/builtins.mod | 79 ------------------------- gcc/testsuite/gm2/pim/run/pass/math.mod | 44 -------------- gcc/testsuite/gm2/pim/run/pass/math2.mod | 44 -------------- gcc/testsuite/gm2/pim/run/pass/testbuiltins.mod | 79 +++++++++++++++++++++++++ gcc/testsuite/gm2/pim/run/pass/testmath.mod | 44 ++++++++++++++ gcc/testsuite/gm2/pim/run/pass/testmath2.mod | 44 ++++++++++++++ 8 files changed, 220 insertions(+), 220 deletions(-) delete mode 100644 gcc/testsuite/gm2/pim/pass/stdio.mod create mode 100644 gcc/testsuite/gm2/pim/pass/teststdio.mod delete mode 100644 gcc/testsuite/gm2/pim/run/pass/builtins.mod delete mode 100644 gcc/testsuite/gm2/pim/run/pass/math.mod delete mode 100644 gcc/testsuite/gm2/pim/run/pass/math2.mod create mode 100644 gcc/testsuite/gm2/pim/run/pass/testbuiltins.mod create mode 100644 gcc/testsuite/gm2/pim/run/pass/testmath.mod create mode 100644 gcc/testsuite/gm2/pim/run/pass/testmath2.mod (limited to 'gcc') diff --git a/gcc/testsuite/gm2/pim/pass/stdio.mod b/gcc/testsuite/gm2/pim/pass/stdio.mod deleted file mode 100644 index f121a8c..0000000 --- a/gcc/testsuite/gm2/pim/pass/stdio.mod +++ /dev/null @@ -1,53 +0,0 @@ -(* Copyright (C) 2015 Free Software Foundation, Inc. *) -(* This file is part of GNU Modula-2. - -GNU Modula-2 is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with gm2; see the file COPYING. If not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. *) - -MODULE stdio ; (*!m2pim*) - -CONST - MaxStack = 40 ; - -TYPE - ProcWrite = PROCEDURE (CHAR) ; - -VAR - StackW : ARRAY [0..MaxStack] OF ProcWrite ; - StackWPtr: CARDINAL ; - - -PROCEDURE write (ch: CHAR) ; -BEGIN - -END write ; - - -PROCEDURE PushOutput (p: ProcWrite) ; -BEGIN - IF StackWPtr=MaxStack - THEN - HALT - ELSE - INC(StackWPtr) ; - StackW[StackWPtr] := p - END -END PushOutput ; - - -BEGIN - StackWPtr := 0 ; - PushOutput(write) -END stdio. diff --git a/gcc/testsuite/gm2/pim/pass/teststdio.mod b/gcc/testsuite/gm2/pim/pass/teststdio.mod new file mode 100644 index 0000000..f67b1c7 --- /dev/null +++ b/gcc/testsuite/gm2/pim/pass/teststdio.mod @@ -0,0 +1,53 @@ +(* Copyright (C) 2015 Free Software Foundation, Inc. *) +(* This file is part of GNU Modula-2. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with gm2; see the file COPYING. If not, write to the Free Software +Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. *) + +MODULE teststdio ; (*!m2pim*) + +CONST + MaxStack = 40 ; + +TYPE + ProcWrite = PROCEDURE (CHAR) ; + +VAR + StackW : ARRAY [0..MaxStack] OF ProcWrite ; + StackWPtr: CARDINAL ; + + +PROCEDURE write (ch: CHAR) ; +BEGIN + +END write ; + + +PROCEDURE PushOutput (p: ProcWrite) ; +BEGIN + IF StackWPtr=MaxStack + THEN + HALT + ELSE + INC(StackWPtr) ; + StackW[StackWPtr] := p + END +END PushOutput ; + + +BEGIN + StackWPtr := 0 ; + PushOutput(write) +END teststdio. diff --git a/gcc/testsuite/gm2/pim/run/pass/builtins.mod b/gcc/testsuite/gm2/pim/run/pass/builtins.mod deleted file mode 100644 index 1cf9fb7..0000000 --- a/gcc/testsuite/gm2/pim/run/pass/builtins.mod +++ /dev/null @@ -1,79 +0,0 @@ -MODULE builtins ; (*!m2pim+gm2*) - -FROM Builtins IMPORT log10l ; -FROM libc IMPORT printf, exit ; -FROM libm IMPORT powl ; - - -(* - doPowerOfTen - safely returns the exponent of a LONGREAL as an INTEGER. -*) - -PROCEDURE doPowerOfTen (r: LONGREAL) : INTEGER ; -VAR - i : INTEGER ; - c, d: LONGREAL ; -BEGIN - IF r=0.0 - THEN - RETURN( 0 ) - ELSE - IF r<0.0 - THEN - c := -r - ELSE - c := r - END ; - IF c>=1.0 - THEN - RETURN( VAL(INTEGER, log10l (c)) ) - ELSE - i := 0 ; - LOOP - d := c*powl(10.0, VAL(LONGREAL, i)) ; - IF d>=1.0 - THEN - RETURN( -i ) - ELSE - INC(i) - END - END - END - END -END doPowerOfTen ; - - -PROCEDURE test ; -BEGIN - Assert (doPowerOfTen (1.0), 0) ; - Assert (doPowerOfTen (10.0), 1) ; - Assert (doPowerOfTen (100.0), 2) ; - Assert (doPowerOfTen (-1.0), 0) ; - Assert (doPowerOfTen (-10.0), 1) ; - Assert (doPowerOfTen (-100.0), 2) -END test ; - - -(* - Assert - -*) - -PROCEDURE Assert (func, actual: INTEGER) ; -BEGIN - IF func = actual - THEN - printf ("success: computed %d = actual %d\n", func, actual) - ELSE - printf ("failure: computed %d # actual %d\n", func, actual) ; - code := 1 - END -END Assert ; - - -VAR - code: INTEGER ; -BEGIN - code := 0 ; - test ; - exit (code) -END builtins. diff --git a/gcc/testsuite/gm2/pim/run/pass/math.mod b/gcc/testsuite/gm2/pim/run/pass/math.mod deleted file mode 100644 index 8eab79d..0000000 --- a/gcc/testsuite/gm2/pim/run/pass/math.mod +++ /dev/null @@ -1,44 +0,0 @@ -(* Copyright (C) 2008 Free Software Foundation, Inc. *) -(* This file is part of GNU Modula-2. - -GNU Modula-2 is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with gm2; see the file COPYING. If not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *) - -MODULE math ; - -IMPORT MathLib0, SMathLib0 ; -FROM libc IMPORT printf, exit ; - - -PROCEDURE Assert (b: BOOLEAN; f: ARRAY OF CHAR; l: CARDINAL) ; -BEGIN - IF NOT b - THEN - printf("%s:%d: assert failed\n", f, l) ; - exit(1) - END -END Assert ; - - -VAR - r: REAL ; - s: SHORTREAL ; -BEGIN - r := 2.3 ; - printf("value of entier (10.0 + r) = %d (should be 12)\n", MathLib0.entier (10.0 + r)) ; - Assert(MathLib0.entier (10.0 + r) = 12, __FILE__, __LINE__) ; - s := 5.9 ; - printf("value of SMathLib0.entier (10.0 + s) = %d (should be 15)\n", SMathLib0.entier (10.0 + s)) ; - Assert(SMathLib0.entier (10.0 + s) = 15, __FILE__, __LINE__) ; -END math. diff --git a/gcc/testsuite/gm2/pim/run/pass/math2.mod b/gcc/testsuite/gm2/pim/run/pass/math2.mod deleted file mode 100644 index 3dd2709..0000000 --- a/gcc/testsuite/gm2/pim/run/pass/math2.mod +++ /dev/null @@ -1,44 +0,0 @@ -(* Copyright (C) 2008 Free Software Foundation, Inc. *) -(* This file is part of GNU Modula-2. - -GNU Modula-2 is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with gm2; see the file COPYING. If not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *) - -MODULE math2 ; - -IMPORT MathLib0, SMathLib0 ; -FROM libc IMPORT printf, exit ; - - -PROCEDURE Assert (b: BOOLEAN; f: ARRAY OF CHAR; l: CARDINAL) ; -BEGIN - IF NOT b - THEN - printf("%s:%d: assert failed\n", f, l) ; - exit(1) - END -END Assert ; - - -VAR - r: REAL ; - s: SHORTREAL ; -BEGIN - r := 2.3 ; - printf("value of entier (10.0 + r) = %d (should be 12)\n", MathLib0.entier (10.0 + r)) ; - Assert(MathLib0.entier (r + 10.0) = 12, __FILE__, __LINE__) ; - s := 5.9 ; - printf("value of SMathLib0.entier (10.0 + s) = %d (should be 15)\n", SMathLib0.entier (10.0 + s)) ; - Assert(SMathLib0.entier (s + 10.0) = 15, __FILE__, __LINE__) ; -END math2. diff --git a/gcc/testsuite/gm2/pim/run/pass/testbuiltins.mod b/gcc/testsuite/gm2/pim/run/pass/testbuiltins.mod new file mode 100644 index 0000000..2fbea37 --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testbuiltins.mod @@ -0,0 +1,79 @@ +MODULE testbuiltins ; (*!m2pim+gm2*) + +FROM Builtins IMPORT log10l ; +FROM libc IMPORT printf, exit ; +FROM libm IMPORT powl ; + + +(* + doPowerOfTen - safely returns the exponent of a LONGREAL as an INTEGER. +*) + +PROCEDURE doPowerOfTen (r: LONGREAL) : INTEGER ; +VAR + i : INTEGER ; + c, d: LONGREAL ; +BEGIN + IF r=0.0 + THEN + RETURN( 0 ) + ELSE + IF r<0.0 + THEN + c := -r + ELSE + c := r + END ; + IF c>=1.0 + THEN + RETURN( VAL(INTEGER, log10l (c)) ) + ELSE + i := 0 ; + LOOP + d := c*powl(10.0, VAL(LONGREAL, i)) ; + IF d>=1.0 + THEN + RETURN( -i ) + ELSE + INC(i) + END + END + END + END +END doPowerOfTen ; + + +PROCEDURE test ; +BEGIN + Assert (doPowerOfTen (1.0), 0) ; + Assert (doPowerOfTen (10.0), 1) ; + Assert (doPowerOfTen (100.0), 2) ; + Assert (doPowerOfTen (-1.0), 0) ; + Assert (doPowerOfTen (-10.0), 1) ; + Assert (doPowerOfTen (-100.0), 2) +END test ; + + +(* + Assert - +*) + +PROCEDURE Assert (func, actual: INTEGER) ; +BEGIN + IF func = actual + THEN + printf ("success: computed %d = actual %d\n", func, actual) + ELSE + printf ("failure: computed %d # actual %d\n", func, actual) ; + code := 1 + END +END Assert ; + + +VAR + code: INTEGER ; +BEGIN + code := 0 ; + test ; + exit (code) +END testbuiltins. diff --git a/gcc/testsuite/gm2/pim/run/pass/testmath.mod b/gcc/testsuite/gm2/pim/run/pass/testmath.mod new file mode 100644 index 0000000..19caf57 --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testmath.mod @@ -0,0 +1,44 @@ +(* Copyright (C) 2008 Free Software Foundation, Inc. *) +(* This file is part of GNU Modula-2. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with gm2; see the file COPYING. If not, write to the Free Software +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *) + +MODULE testmath ; + +IMPORT MathLib0, SMathLib0 ; +FROM libc IMPORT printf, exit ; + + +PROCEDURE Assert (b: BOOLEAN; f: ARRAY OF CHAR; l: CARDINAL) ; +BEGIN + IF NOT b + THEN + printf("%s:%d: assert failed\n", f, l) ; + exit(1) + END +END Assert ; + + +VAR + r: REAL ; + s: SHORTREAL ; +BEGIN + r := 2.3 ; + printf("value of entier (10.0 + r) = %d (should be 12)\n", MathLib0.entier (10.0 + r)) ; + Assert(MathLib0.entier (10.0 + r) = 12, __FILE__, __LINE__) ; + s := 5.9 ; + printf("value of SMathLib0.entier (10.0 + s) = %d (should be 15)\n", SMathLib0.entier (10.0 + s)) ; + Assert(SMathLib0.entier (10.0 + s) = 15, __FILE__, __LINE__) ; +END testmath. diff --git a/gcc/testsuite/gm2/pim/run/pass/testmath2.mod b/gcc/testsuite/gm2/pim/run/pass/testmath2.mod new file mode 100644 index 0000000..483372d --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testmath2.mod @@ -0,0 +1,44 @@ +(* Copyright (C) 2008 Free Software Foundation, Inc. *) +(* This file is part of GNU Modula-2. + +GNU Modula-2 is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with gm2; see the file COPYING. If not, write to the Free Software +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *) + +MODULE testmath2 ; + +IMPORT MathLib0, SMathLib0 ; +FROM libc IMPORT printf, exit ; + + +PROCEDURE Assert (b: BOOLEAN; f: ARRAY OF CHAR; l: CARDINAL) ; +BEGIN + IF NOT b + THEN + printf("%s:%d: assert failed\n", f, l) ; + exit(1) + END +END Assert ; + + +VAR + r: REAL ; + s: SHORTREAL ; +BEGIN + r := 2.3 ; + printf("value of entier (10.0 + r) = %d (should be 12)\n", MathLib0.entier (10.0 + r)) ; + Assert(MathLib0.entier (r + 10.0) = 12, __FILE__, __LINE__) ; + s := 5.9 ; + printf("value of SMathLib0.entier (10.0 + s) = %d (should be 15)\n", SMathLib0.entier (10.0 + s)) ; + Assert(SMathLib0.entier (s + 10.0) = 15, __FILE__, __LINE__) ; +END testmath2. -- cgit v1.1