diff options
Diffstat (limited to 'gcc/testsuite/gm2')
-rw-r--r-- | gcc/testsuite/gm2/cse/pass/testcse54.mod | 7 | ||||
-rw-r--r-- | gcc/testsuite/gm2/iso/run/pass/array9.mod | 28 | ||||
-rw-r--r-- | gcc/testsuite/gm2/iso/run/pass/strcons3.mod | 30 | ||||
-rw-r--r-- | gcc/testsuite/gm2/iso/run/pass/strcons4.mod | 36 | ||||
-rw-r--r-- | gcc/testsuite/gm2/pim/fail/badset1.mod | 13 | ||||
-rw-r--r-- | gcc/testsuite/gm2/pim/fail/badset2.mod | 13 | ||||
-rw-r--r-- | gcc/testsuite/gm2/pim/fail/badset3.mod | 11 | ||||
-rw-r--r-- | gcc/testsuite/gm2/pim/fail/badset4.mod | 11 |
8 files changed, 149 insertions, 0 deletions
diff --git a/gcc/testsuite/gm2/cse/pass/testcse54.mod b/gcc/testsuite/gm2/cse/pass/testcse54.mod new file mode 100644 index 0000000..5cc1e64 --- /dev/null +++ b/gcc/testsuite/gm2/cse/pass/testcse54.mod @@ -0,0 +1,7 @@ +MODULE testcse54 ; + +VAR + a: ARRAY [0..10] OF CHAR ; +BEGIN + a := 'hello' +END testcse54. diff --git a/gcc/testsuite/gm2/iso/run/pass/array9.mod b/gcc/testsuite/gm2/iso/run/pass/array9.mod new file mode 100644 index 0000000..dd3304e --- /dev/null +++ b/gcc/testsuite/gm2/iso/run/pass/array9.mod @@ -0,0 +1,28 @@ +(* Copyright (C) 2009 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 array9 ; + + +PROCEDURE assign (a: ARRAY OF ARRAY OF CARDINAL) ; +END assign ; + +VAR + e: ARRAY [1..5] OF ARRAY [0..29] OF CARDINAL ; +BEGIN + assign(e) +END array9. diff --git a/gcc/testsuite/gm2/iso/run/pass/strcons3.mod b/gcc/testsuite/gm2/iso/run/pass/strcons3.mod new file mode 100644 index 0000000..7950e64 --- /dev/null +++ b/gcc/testsuite/gm2/iso/run/pass/strcons3.mod @@ -0,0 +1,30 @@ +(* Copyright (C) 2024 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 strcons3 ; + + +TYPE + NameType = ARRAY [0..24] OF CHAR ; + PersonType = RECORD + name: NameType ; + END ; +VAR + person: PersonType ; +BEGIN + person := PersonType{"Blaise Pascal"} +END strcons3. diff --git a/gcc/testsuite/gm2/iso/run/pass/strcons4.mod b/gcc/testsuite/gm2/iso/run/pass/strcons4.mod new file mode 100644 index 0000000..1c0e350 --- /dev/null +++ b/gcc/testsuite/gm2/iso/run/pass/strcons4.mod @@ -0,0 +1,36 @@ +(* Copyright (C) 2024 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 strcons4 ; + + +TYPE + NameType = ARRAY [0..24] OF CHAR ; + DateType = RECORD + year, month, day: CARDINAL ; + END ; + PersonType = RECORD + name: NameType ; + DateOfBirth: DateType ; + END ; +VAR + date : DateType ; + person: PersonType ; +BEGIN + date := DateType{1623, 6, 19} ; + person := PersonType{"Blaise Pascal", date} ; +END strcons4. diff --git a/gcc/testsuite/gm2/pim/fail/badset1.mod b/gcc/testsuite/gm2/pim/fail/badset1.mod new file mode 100644 index 0000000..de56fe3 --- /dev/null +++ b/gcc/testsuite/gm2/pim/fail/badset1.mod @@ -0,0 +1,13 @@ +MODULE badset1 ; + +FROM libc IMPORT printf ; + +VAR + s: SET OF [1..10] ; + c: CARDINAL ; +BEGIN + IF c = s + THEN + printf ("broken\n") + END +END badset1. diff --git a/gcc/testsuite/gm2/pim/fail/badset2.mod b/gcc/testsuite/gm2/pim/fail/badset2.mod new file mode 100644 index 0000000..b8c798f --- /dev/null +++ b/gcc/testsuite/gm2/pim/fail/badset2.mod @@ -0,0 +1,13 @@ +MODULE badset2 ; + +FROM libc IMPORT printf ; + +VAR + s: SET OF [1..10] ; + c: CARDINAL ; +BEGIN + IF c # s + THEN + printf ("broken\n") + END +END badset2. diff --git a/gcc/testsuite/gm2/pim/fail/badset3.mod b/gcc/testsuite/gm2/pim/fail/badset3.mod new file mode 100644 index 0000000..fcbf177 --- /dev/null +++ b/gcc/testsuite/gm2/pim/fail/badset3.mod @@ -0,0 +1,11 @@ +MODULE badset3 ; + + +VAR + s10: SET OF [1..10] ; + s20: SET OF [1..20] ; +BEGIN + IF s10 = s20 + THEN + END +END badset3. diff --git a/gcc/testsuite/gm2/pim/fail/badset4.mod b/gcc/testsuite/gm2/pim/fail/badset4.mod new file mode 100644 index 0000000..2382e4e --- /dev/null +++ b/gcc/testsuite/gm2/pim/fail/badset4.mod @@ -0,0 +1,11 @@ +MODULE badset4 ; + + +VAR + s10: SET OF [1..10] ; + s20: SET OF [1..20] ; +BEGIN + IF s10 > s20 + THEN + END +END badset4. |