https://gcc.gnu.org/g:8fae61cddc1079d473cfd16d42cc570ea9a84f13
commit r16-5770-g8fae61cddc1079d473cfd16d42cc570ea9a84f13 Author: Jose E. Marchesi <[email protected]> Date: Sat Oct 11 19:58:33 2025 +0200 a68: testsuite: mcgt tests Signed-off-by: Jose E. Marchesi <[email protected]> gcc/testsuite/ChangeLog * algol68/compile/mcgt-1.3b.a68: New file. * algol68/compile/mcgt-7.1.3a-bis.a68: Likewise. * algol68/compile/mcgt-7.1.3a.a68: Likewise. * algol68/execute/mcgt/execute.exp: Likewise. * algol68/execute/mcgt/mcgt-1.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-1.3c.a68: Likewise. * algol68/execute/mcgt/mcgt-2.2.1a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.2.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.2.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.3b.a68: Likewise. * algol68/execute/mcgt/mcgt-2.3c.a68: Likewise. * algol68/execute/mcgt/mcgt-2.3e.a68: Likewise. * algol68/execute/mcgt/mcgt-2.4.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.4.2b.a68: Likewise. * algol68/execute/mcgt/mcgt-2.4.2c.a68: Likewise. * algol68/execute/mcgt/mcgt-2.4.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.6a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.6b.a68: Likewise. * algol68/execute/mcgt/mcgt-2.7d.a68: Likewise. * algol68/execute/mcgt/mcgt-2.7e.a68: Likewise. * algol68/execute/mcgt/mcgt-2.8a.a68: Likewise. * algol68/execute/mcgt/mcgt-2.8b.a68: Likewise. * algol68/execute/mcgt/mcgt-2.9.1a.a68: Likewise. * algol68/execute/mcgt/mcgt-3.5.1a.a68: Likewise. * algol68/execute/mcgt/mcgt-3.5d.a68: Likewise. * algol68/execute/mcgt/mcgt-3.7.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-3.8.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-3.9.1b.a68: Likewise. * algol68/execute/mcgt/mcgt-4.1.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-4.1.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-4.1.6a.a68: Likewise. * algol68/execute/mcgt/mcgt-4.1.6b.a68: Likewise. * algol68/execute/mcgt/mcgt-4.1.6c.a68: Likewise. * algol68/execute/mcgt/mcgt-4.2.6a.a68: Likewise. * algol68/execute/mcgt/mcgt-4.2.6b.a68: Likewise. * algol68/execute/mcgt/mcgt-4.2.6d.a68: Likewise. * algol68/execute/mcgt/mcgt-4.3.1a.a68: Likewise. * algol68/execute/mcgt/mcgt-4.3.1b.a68: Likewise. * algol68/execute/mcgt/mcgt-4.3.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-5.1.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-5.1.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-5.1.3c.a68: Likewise. * algol68/execute/mcgt/mcgt-5.1.5a.a68: Likewise. * algol68/execute/mcgt/mcgt-6.2.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-6.2.2b.a68: Likewise. * algol68/execute/mcgt/mcgt-6.2.2c.a68: Likewise. * algol68/execute/mcgt/mcgt-7.1.1a.a68: Likewise. * algol68/execute/mcgt/mcgt-7.1.1b.a68: Likewise. * algol68/execute/mcgt/mcgt-7.1.3a.a68: Likewise. * algol68/execute/mcgt/mcgt-7.3.2a.a68: Likewise. * algol68/execute/mcgt/mcgt-7.3.6a.a68: Likewise. * algol68/execute/mcgt/mcgt-7.3.6b.a68: Likewise. * algol68/execute/mcgt/mcgt-7.5.3a.a68: Likewise. Diff: --- gcc/testsuite/algol68/compile/mcgt-1.3b.a68 | 5 ++++ gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 | 8 ++++++ gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 | 8 ++++++ gcc/testsuite/algol68/execute/mcgt/execute.exp | 29 ++++++++++++++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 | 4 +++ gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 | 4 +++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 | 4 +++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 | 4 +++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 | 11 ++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 | 9 +++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 | 4 +++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 | 10 ++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 | 9 +++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 | 13 ++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 | 16 ++++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 | 9 +++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 | 8 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 | 11 ++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 | 7 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 | 15 +++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 | 15 +++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 | 12 +++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 | 29 ++++++++++++++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 | 19 ++++++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 | 5 ++++ gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 | 6 +++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 | 8 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 | 11 ++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 | 8 ++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 | 11 ++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 | 23 +++++++++++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 | 12 +++++++++ gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 | 8 ++++++ 54 files changed, 476 insertions(+) diff --git a/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 b/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 new file mode 100644 index 000000000000..80fc4a1c976f --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-1.3b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # + +BEGIN REAL r := 10.0, circum, area; + circum := 2 * pi * r; area := pi * r * r +END diff --git a/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 b/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 new file mode 100644 index 000000000000..132f0c57972e --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-7.1.3a-bis.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + # Illegal, cannot remember transient name. # + REF[]INT q2 = p[3,]; # { dg-error "" } # + SKIP +END diff --git a/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 b/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 new file mode 100644 index 000000000000..be3f12ac7e3c --- /dev/null +++ b/gcc/testsuite/algol68/compile/mcgt-7.1.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # + +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + # Illegal. p cannot be deflexed since it is a REF FLEX. # + REF[,]INT q3 = p; # { dg-error "" } # + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/execute.exp b/gcc/testsuite/algol68/execute/mcgt/execute.exp new file mode 100644 index 000000000000..f07333f483aa --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/execute.exp @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# This program 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 of the License, or +# (at your option) any later version. +# +# This program 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +if $tracelevel then { + strace $tracelevel +} + +load_lib algol68-torture.exp + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.a68]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $testcase] then { + continue + } + algol68-torture-execute $testcase +} diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 new file mode 100644 index 000000000000..c99c25feb888 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN REAL e = 2.7182818284; REAL circum; + circum := 2 * pi * e +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 new file mode 100644 index 000000000000..883d4e918ae4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-1.3c.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 10, result; + result := n * (n + 1) * (2 * n + 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 new file mode 100644 index 000000000000..4179a8221d47 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.1a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Integer denotations. # +BEGIN 000; 43; 456; 0 +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 new file mode 100644 index 000000000000..3bd34667dde0 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Real denotations. # +BEGIN .5; 0.5; 2.0; .001; + 2.3e1; 2e0; 2e+0; 2e-0 +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 new file mode 100644 index 000000000000..a9aa44c31995 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.2.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Character denotations. # +BEGIN "X"; "a"; "1"; "."; " " +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 new file mode 100644 index 000000000000..e8f403b119b2 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Identifiers. # +BEGIN INT circum, r, ibm, a1, log2, begin; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 new file mode 100644 index 000000000000..be7368f24a9a --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Identity declarations. # +BEGIN REAL e = 2.7182818284, log2 = 0.618, INT ten = 10, g = 32; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 new file mode 100644 index 000000000000..676f9892bd88 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3c.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Equivalent declarations. # +BEGIN REAL x = 2.34; + REF INT n = LOC INT, REF INT m = LOC INT; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 new file mode 100644 index 000000000000..1a0dffe1e4be --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.3e.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Initialisation. # +BEGIN CHAR firstchar := "A", lastchar := "Z", currentchar; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 new file mode 100644 index 000000000000..f304b8f21b62 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Ordinary division. # +BEGIN ASSERT (4/2 = 2.0); + INT a = 4, b = 7; + a/b # Yields a value of mode REAL. # +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 new file mode 100644 index 000000000000..ed0b0c48676f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2b.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Integer division. The operator OVER (%) performs integer + division with truncation. # +BEGIN ASSERT (4 % 2 = 2); + ASSERT (4 OVER 2 = 2); + ASSERT (5 % 3 = 1); + ASSERT (5 OVER 3 = 1); + INT n = -5, m = -3; + ASSERT (n % 3 = -1); + ASSERT (n % m = 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 new file mode 100644 index 000000000000..a63eb7eeb5cb --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.2c.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Integer modulus. The operator MOD (%*) performs integer modulus + with truncation. # +BEGIN ASSERT (0 MOD 4 = 0); + ASSERT (0 %* 4 = 0); + ASSERT (5 %* 3 = 2); + INT m = 5, n = -3; + ASSERT (m MOD n = 2) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 new file mode 100644 index 000000000000..d8707ee83a40 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.4.3a.a68 @@ -0,0 +1,4 @@ +# { dg-options "-fstropping=upper" } # +# Exponentiation. # +BEGIN ASSERT (2 ** 3 = 8) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 new file mode 100644 index 000000000000..68f8ee13ea41 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Comparison operators. # +BEGIN REAL x = 2.7, y = 3.6, z = 4.7; + ASSERT (x < y); + ASSERT ("B" /= "C") +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 new file mode 100644 index 000000000000..c61342f3ac0b --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.6b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Comparison operators and boolean operators. # +BEGIN INT a = 4, b = 5, c = 9, REAL x = 4.7, y = 5.7, z = 6.7; + ASSERT (NOT (x + y < z) AND a + b = c) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 new file mode 100644 index 000000000000..aa035f264e37 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7d.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Widening. # +BEGIN REAL x := 4, y := 7, z := 2.7; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 new file mode 100644 index 000000000000..ad423a5a81ec --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.7e.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Dereferencing and widening. # +BEGIN INT n, REAL x = n; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 new file mode 100644 index 000000000000..23d5e5158d4c --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Examples of assignations. # +BEGIN REAL pi = 3.14, e = 2.71, INT n = 10, REAL circum, INT result; + circum := 2 * pi * e; + result := n * (n + 1) * ( 2 * n + 1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 new file mode 100644 index 000000000000..1b5d642b8f85 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.8b.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Coercions and assignations. # +BEGIN REAL y, INT n, m := 1; + y := n % m +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 new file mode 100644 index 000000000000..e5e2e781591e --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-2.9.1a.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Arithmetical assignment operators. # +BEGIN INT m, n := 4; + n PLUSAB 1; + ASSERT (n = 5) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 new file mode 100644 index 000000000000..85080ea32014 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5.1a.a68 @@ -0,0 +1,10 @@ +# { dg-options "-fstropping=upper" } # +# Equivalence. # +BEGIN INT m := 3; REF INT p = m; + ASSERT (m = 3 AND p = 3); + BEGIN INT m := 100; + ASSERT (m = 100 AND p = 3); + m -:= 1; p +:= 1 + END; + ASSERT (m = 4 AND p = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 new file mode 100644 index 000000000000..5f02498ec827 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.5d.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# On the availability and accessibility of space. # +BEGIN INT m := 3, INT five = 5; + ASSERT (m = 3); + BEGIN INT m := 100; CHAR five = "5"; + m +:= 1 + END; + ASSERT (m = 3 AND five = 5) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 new file mode 100644 index 000000000000..b6514eb8afe8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.7.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT p := 10, q := 12; + FROM p TO q DO (p +:= 1, q +:= 1) OD; + ASSERT (p = 13 AND q = 15) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 new file mode 100644 index 000000000000..bfc67c9dbb69 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.8.2a.a68 @@ -0,0 +1,13 @@ +# { dg-options "-fstropping=upper" } # +# Using case clauses. # +BEGIN PROC is divisible = (INT m) BOOL: + BEGIN BOOL divisible := FALSE; + FOR i TO 4 WHILE NOT divisible + DO INT k = (i|3, 5, 7, 11); + divisible := m MOD k = 0 + OD; + divisible + END; + ASSERT (is divisible (50)); + ASSERT (is divisible (253)) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 new file mode 100644 index 000000000000..01ef062fb5fc --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-3.9.1b.a68 @@ -0,0 +1,16 @@ +# { dg-options "-fstropping=upper" } # +# Using jumps. # +BEGIN INT a, INT b = 0, c = 2, d = 10, BOOL e = TRUE; + CO The following program using jumps is equivalent to: + FOR a FROM b BY c TO d WHILE e DO SKIP OD + CO + BEGIN INT j := b, INT k = c, m = d; + next: IF (k > 0 AND j <= m) OR (k < 0 AND j >= m) OR k = 0 + THEN INT i = j; + IF e + THEN SKIP; j +:= k; GOTO next + FI + FI; + ASSERT (j = 12) + END +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 new file mode 100644 index 000000000000..98e43c62334a --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.2a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Monadic lwb and upb. # +BEGIN INT n := 4; [n]INT a; + ASSERT (UPB a = 4); + n := 6; + ASSERT (UPB a = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 new file mode 100644 index 000000000000..b2592404700f --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.3a.a68 @@ -0,0 +1,9 @@ +# { dg-options "-fstropping=upper" } # +# Dyadic lwb an upb. # +BEGIN [0:10,-4:100]REAL xx; + ASSERT (1 LWB xx = 0); + ASSERT (1 UPB xx = 10); + ASSERT (1 UPB xx = UPB xx); + ASSERT (2 LWB xx = -4); + ASSERT (2 UPB xx = 100) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 new file mode 100644 index 000000000000..e17a9ccc17b4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +BEGIN [4]REAL x2 := (6, 7, 8, 9); + ASSERT (x2[2] > 6.9); + ASSERT (x2[2] < 7.1); + x2 := (1, 1, 1, 1); + ASSERT(x2[2] > 0.9); + ASSERT(x2[2] < 1.1) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 new file mode 100644 index 000000000000..09302dac5f2e --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6b.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Multi-dimensional row displays. # +BEGIN [2,3]INT aa := ((1,2,3),(4,5,6)); + [2,3,4]REAL bb := (((1,2,3,4), (5,6,7,8), (9,10,11,12)), + ((13,14,15,16),(17,18,19,20),(21,22,2,24))); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 new file mode 100644 index 000000000000..241e134bf72c --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.1.6c.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Further row displays. # +BEGIN [4]INT a, b; + [4]INT c := a, d := (1,2,3,0); + [2,4]INT ab := (a,b), cd := ((0,0,0,0), b); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 new file mode 100644 index 000000000000..ed1fa42771a8 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN STRUCT (INT day, month, year) indep day = (4, 7, 1776); + ASSERT (day OF indep day = 4); + ASSERT (month OF indep day = 7); + ASSERT (year OF indep day = 1776); + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 new file mode 100644 index 000000000000..2f1ad2021d4d --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6b.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +BEGIN []STRUCT(CHAR letter, INT integer) roman + = (("I",1),("V",5),("X",10),("L",50),("C",100)); + # XXX letter OF roman should be ("I","V","X","L","C") # + # XXX integer OF roman whould be (1,5,10,50,100) # + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 new file mode 100644 index 000000000000..8718efd7cd53 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.2.6d.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Multiple values and structures. + + Having strings of different lenghts would not be valid in a variable + declaration, but is acceptable in an identity declaration. +# +BEGIN []STRUCT ([]CHAR name, INT age) family = + (("JOHN", 3), ("ROBERT", 1), ("CATHERINE", 4)); + SKIP +END + diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 new file mode 100644 index 000000000000..0fae194fb227 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1a.a68 @@ -0,0 +1,7 @@ +# { dg-options "-fstropping=upper" } # +# Simple mode declarations. # +BEGIN MODE INTEGER = INT; + MODE Z = INT, R = REAL, B = BOOL, V = VOID; + MODE ARRAYA = [100]INT, ARRAYB = [10,2:9]REAL; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 new file mode 100644 index 000000000000..d98d7ec117e5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.1b.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +# Dynamic arrays revisited. # +BEGIN INT p := 2, q := 10; + MODE M = [p:q]INT; + M a; + ASSERT (LWB a = 2 AND UPB a = 10); + q := 4; + M b; + ASSERT (LWB a = 2 AND UPB a = 10); + ASSERT (LWB b = 2 AND UPB b = 4); + M c = (1,2,3,4); # M is interpreted as formal declarer. + Bounds are ignored. + # + ASSERT (LWB c = 1 AND UPB c = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 new file mode 100644 index 000000000000..039a661a62f1 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-4.3.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Rows of integers. # +BEGIN [][]INT g = ((1,2,3),(4,5),(6,7,8,9)); + ASSERT (UPB g[1] = 3 AND UPB g[2] = 2 AND UPB g[3] = 4) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 new file mode 100644 index 000000000000..9d77795ad8d4 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.2a.a68 @@ -0,0 +1,15 @@ +# { dg-options "-fstropping=upper" } # +# Procedure declarations I. # +BEGIN INT x = 10, y = 20, i = 2; + PROC xxx = (INT arg) INT: 10; + PROC yyy = (INT arg) INT: 20; + PROC zzz = (INT arg) INT: 30; + PROC(INT)INT f = IF x > y THEN xxx ELSE zzz FI, + g = CASE i IN xxx, yyy, zzz ESAC; + PROC(INT)INT h := IF x < y THEN xxx ELSE yyy FI; + ASSERT (f (100) = 30); + ASSERT (g (200) = 20); + ASSERT (h (300) = 10); + h := yyy; + ASSERT (h (300) = 20) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 new file mode 100644 index 000000000000..45efc9c8834e --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3a.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +# Using the factorial function in a program # +BEGIN PROC f = (INT n) INT: + BEGIN INT product := 1; + FOR i TO n DO product *:= i OD; + product + END; + ASSERT (f(0) = 1); + ASSERT (f(1) = 1); + ASSERT (f(2) = 2); + ASSERT (f(3) = 6) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 new file mode 100644 index 000000000000..fcd93c85c441 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.3c.a68 @@ -0,0 +1,29 @@ +# { dg-options "-fstropping=upper" } # +# Procedure declarations III # +BEGIN # From the ALGOL68 Revised Report. # + PROC my char in string = (CHAR c, REF INT i, []CHAR s) BOOL: + BEGIN BOOL found := FALSE; + FOR k FROM LWB s TO UPB s WHILE NOT found + DO (c = s[k] | i := k; found := TRUE) OD; + found + END; + ASSERT ((INT idx := 0; + my char in string ("o", idx, "foo") + ANDTH idx = 2)); + ASSERT (my char in string ("x", LOC INT, "foo") = FALSE); + # Swapping function. # + PROC swap = (REF INT a, b) VOID: + (INT r = a; a := b; b := r); + ASSERT ((INT x := 1, y := 2; + swap (x, y); + x = 2 AND y = 1)); + # Euclid's algorithm. # + PROC hcf = (INT m, n) INT: + BEGIN INT a := m, b := n; + IF a < b THEN swap (a, b) FI; + WHILE b /= 0 + DO INT c = b; b := a MOD b; a := c OD; + a + END; + ASSERT (hcf (10, 20) = 10) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 new file mode 100644 index 000000000000..4f61bf02a237 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-5.1.5a.a68 @@ -0,0 +1,19 @@ +# { dg-options "-fstropping=upper" } # +# Recursive procedures. # +BEGIN PROC f = (INT m, n) INT: + IF n = 0 + THEN m + ELIF m < n + THEN f (n, m) + ELSE m * f (m % n, n - 1) + n * f (m - 1, n) + FI; + f (10, 20); + PROC a = (INT m, n) INT: + IF m = 0 + THEN + 1 + ELIF n = 0 + THEN a (m - 1, 1) + ELSE a (m - 1, a (m, n - 1)) + FI; + a (10, 20) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 new file mode 100644 index 000000000000..b2bed32b302a --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2a.a68 @@ -0,0 +1,5 @@ +# { dg-options "-fstropping=upper" } # +# Using AND and OR # +BEGIN ASSERT ((2r111 AND 2r101) = 2r101); + ASSERT ((16rff AND 2r111) = 16r7) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 new file mode 100644 index 000000000000..b9a4730b9d05 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2b.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Comparing objects of mode BITS # +BEGIN ASSERT (2r1010 <= 2r1110); + ASSERT (4r331 >= 8r74); + ASSERT (NOT (2r100 >= 2r011)) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 new file mode 100644 index 000000000000..79bfc97d9b45 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-6.2.2c.a68 @@ -0,0 +1,6 @@ +# { dg-options "-fstropping=upper" } # +# Using BIN # +BEGIN ASSERT (BIN 7 = 2r111); + INT i = 22; + ASSERT ((BITS b = BIN i; ABS (b SHL 3) + ABS (b SHL 1)) = 220) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 new file mode 100644 index 000000000000..efd948be8075 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Declarations of flexible names. # +BEGIN FLEX[1:0]INT n; + ASSERT (LWB n = 1 AND UPB n = 0 AND ELEMS n = 0); + FLEX[4,6]INT p; + ASSERT (1 LWB p = 1 AND 1 UPB p = 4 AND 1 ELEMS p = 4 + AND 2 LWB p = 1 AND 2 UPB p = 6 AND 2 ELEMS p = 6) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 new file mode 100644 index 000000000000..3360c5eabc23 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.1b.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Null row displays an string denotations. # +BEGIN FLEX[4]INT a, FLEX[4,6]INT b, FLEX[10]CHAR c; + a := (); + ASSERT (LWB a = 1 AND UPB a = 0); + b := ((),()); + ASSERT (1 LWB b = 1 AND 1 UPB b = 2 + AND 2 LWB b = 1 AND 2 UPB b = 0); + c := (); + c := "" +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 new file mode 100644 index 000000000000..b1bfdf737caf --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.1.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Transient references and declarations. # +BEGIN FLEX[4,6]INT p; + []INT q1 = p[3,]; # Transient name is dereferenced giving []INT # + REF FLEX[,]INT q5 = p; # p and q5 are different ways of accessing + the same name. # + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 new file mode 100644 index 000000000000..688bcac00ec6 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.2a.a68 @@ -0,0 +1,11 @@ +# { dg-options "-fstropping=upper" } # +# Virtual declarers. # +BEGIN REF[]INT s; + STRUCT ([10]INT a, [4]REF[]INT b) c; + UNION (REF FLEX[]INT, PROC(INT)INT) f; + FLEX[4][3]INT a; + REF FLEX[][]INT aa = LOC FLEX[4][3]INT; + [4]FLEX[3]INT b; + REF[]FLEX[]INT bb = LOC[4]FLEX[3]INT; + SKIP +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 new file mode 100644 index 000000000000..1fbf6a3772e5 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6a.a68 @@ -0,0 +1,23 @@ +# { dg-options "-fstropping=upper" } # +BEGIN INT n := 3, m := 3; + REF INT w := n, z := n, REF INT y = n; + # Delivers TRUE since y and n deliver the same variable of mode REF + INT. No coercions take place. + # + ASSERT (y :=: n); + # Delivers TRUE. here w is dereferenced to yield n. The right + hand side is taken to be strong since dereferencing cannot + occur in a soft position. + # + ASSERT (n :=: w); + # Similarly delivers TRUE. Strong position is lhs. # + ASSERT (w :=: n); + # Delivers TRUE. No coercions take place. # + ASSERT (y ISNT m); + # Delivers true. w gets coerced to REF INT due to the strong + context introduced by the cast. No further coercions take place. + # + ASSERT (REF INT (w) :=: z); + # Delives true. No coercions take place. # + ASSERT (w :/=: z) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 new file mode 100644 index 000000000000..479339d74855 --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.3.6b.a68 @@ -0,0 +1,12 @@ +# { dg-options "-fstropping=upper" } # +BEGIN + [3]INT a := (1,2,3); + + CO Comparing transient or flex names using an identity relation is + undefined. Therefore, a[2:3] :=: a[2:3] is undefined. + CO + + # But the following are defined. # + ASSERT (a[1] :=: a[1]); + ASSERT (a[1] :/=: a[2]) +END diff --git a/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 new file mode 100644 index 000000000000..dfb8cd40460b --- /dev/null +++ b/gcc/testsuite/algol68/execute/mcgt/mcgt-7.5.3a.a68 @@ -0,0 +1,8 @@ +# { dg-options "-fstropping=upper" } # +# Declarations involving global generators. # +BEGIN REF REAL xx; + BEGIN REF REAL x = HEAP REAL := 4; + xx := x + END; + ASSERT (xx = 4) +END
