aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gm2/pim
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gm2/pim')
-rw-r--r--gcc/testsuite/gm2/pim/fail/badmodvar.mod7
-rw-r--r--gcc/testsuite/gm2/pim/fail/constintarraybyte.mod10
-rw-r--r--gcc/testsuite/gm2/pim/fail/cyclictypes.mod13
-rw-r--r--gcc/testsuite/gm2/pim/fail/cyclictypes2.mod9
-rw-r--r--gcc/testsuite/gm2/pim/fail/cyclictypes4.mod13
-rw-r--r--gcc/testsuite/gm2/pim/fail/testcharint.mod8
-rw-r--r--gcc/testsuite/gm2/pim/fail/testindrx.mod8
-rw-r--r--gcc/testsuite/gm2/pim/pass/ReturnType.mod17
-rw-r--r--gcc/testsuite/gm2/pim/pass/ReturnType2.mod19
-rw-r--r--gcc/testsuite/gm2/pim/pass/forarray.mod21
-rw-r--r--gcc/testsuite/gm2/pim/pass/highbit.mod13
-rw-r--r--gcc/testsuite/gm2/pim/pass/highbit2.mod13
-rw-r--r--gcc/testsuite/gm2/pim/pass/testxindr.mod17
-rw-r--r--gcc/testsuite/gm2/pim/pass/testxindr2.mod17
-rw-r--r--gcc/testsuite/gm2/pim/pass/testxindr3.mod15
15 files changed, 200 insertions, 0 deletions
diff --git a/gcc/testsuite/gm2/pim/fail/badmodvar.mod b/gcc/testsuite/gm2/pim/fail/badmodvar.mod
new file mode 100644
index 0000000..dd90920
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/badmodvar.mod
@@ -0,0 +1,7 @@
+MODULE badmodvar ;
+
+VAR
+ x: y ;
+BEGIN
+
+END badmodvar.
diff --git a/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod b/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod
new file mode 100644
index 0000000..cbcc804
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod
@@ -0,0 +1,10 @@
+MODULE constintarraybyte ;
+
+FROM FormatStrings IMPORT Sprintf1 ;
+FROM DynamicStrings IMPORT String, InitString ;
+
+VAR
+ s: String ;
+BEGIN
+ s := Sprintf1 (InitString("abc%x\n"), 42)
+END constintarraybyte.
diff --git a/gcc/testsuite/gm2/pim/fail/cyclictypes.mod b/gcc/testsuite/gm2/pim/fail/cyclictypes.mod
new file mode 100644
index 0000000..f2adb49
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/cyclictypes.mod
@@ -0,0 +1,13 @@
+MODULE cyclictypes ;
+
+TYPE
+ A = B;
+ B = A;
+
+PROCEDURE foo ;
+VAR
+ bar: A ;
+END foo ;
+
+
+END cyclictypes.
diff --git a/gcc/testsuite/gm2/pim/fail/cyclictypes2.mod b/gcc/testsuite/gm2/pim/fail/cyclictypes2.mod
new file mode 100644
index 0000000..a5630c8
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/cyclictypes2.mod
@@ -0,0 +1,9 @@
+MODULE cyclictypes2 ;
+
+TYPE
+ A = B;
+ B = A;
+
+VAR
+ bar: A ;
+END cyclictypes2.
diff --git a/gcc/testsuite/gm2/pim/fail/cyclictypes4.mod b/gcc/testsuite/gm2/pim/fail/cyclictypes4.mod
new file mode 100644
index 0000000..69f061b
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/cyclictypes4.mod
@@ -0,0 +1,13 @@
+MODULE cyclictypes4 ;
+
+TYPE
+ A = B ;
+ B = C ;
+ C = D ;
+ D = A ;
+
+VAR
+ v: A ;
+BEGIN
+
+END cyclictypes4.
diff --git a/gcc/testsuite/gm2/pim/fail/testcharint.mod b/gcc/testsuite/gm2/pim/fail/testcharint.mod
new file mode 100644
index 0000000..d403651
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/testcharint.mod
@@ -0,0 +1,8 @@
+MODULE testcharint ; (*!m2iso+gm2*)
+
+VAR
+ ch: CHAR ;
+ i : INTEGER ;
+BEGIN
+ ch := i
+END testcharint.
diff --git a/gcc/testsuite/gm2/pim/fail/testindrx.mod b/gcc/testsuite/gm2/pim/fail/testindrx.mod
new file mode 100644
index 0000000..2630ebd
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/testindrx.mod
@@ -0,0 +1,8 @@
+MODULE testindrx ; (*!m2iso+gm2*)
+
+VAR
+ x: ARRAY [1..5] OF INTEGER ;
+ ch: CHAR ;
+BEGIN
+ ch := x[1]
+END testindrx.
diff --git a/gcc/testsuite/gm2/pim/pass/ReturnType.mod b/gcc/testsuite/gm2/pim/pass/ReturnType.mod
new file mode 100644
index 0000000..149bc85
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/ReturnType.mod
@@ -0,0 +1,17 @@
+MODULE ReturnType ;
+
+TYPE
+ bar = POINTER TO CARDINAL ;
+
+
+PROCEDURE foo (VAR value: bar) : bar ;
+BEGIN
+ RETURN value
+END foo ;
+
+VAR
+ b: bar ;
+BEGIN
+ b := NIL ;
+ b := foo (b)
+END ReturnType.
diff --git a/gcc/testsuite/gm2/pim/pass/ReturnType2.mod b/gcc/testsuite/gm2/pim/pass/ReturnType2.mod
new file mode 100644
index 0000000..bab7f5b
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/ReturnType2.mod
@@ -0,0 +1,19 @@
+MODULE ReturnType2 ;
+
+TYPE
+ bar = POINTER TO RECORD
+ field: CARDINAL ;
+ END ;
+
+
+PROCEDURE foo (VAR value: bar) : bar ;
+BEGIN
+ RETURN value
+END foo ;
+
+VAR
+ b: bar ;
+BEGIN
+ b := NIL ;
+ b := foo (b)
+END ReturnType2.
diff --git a/gcc/testsuite/gm2/pim/pass/forarray.mod b/gcc/testsuite/gm2/pim/pass/forarray.mod
new file mode 100644
index 0000000..e1b41e7
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/forarray.mod
@@ -0,0 +1,21 @@
+MODULE forarray ;
+
+
+VAR
+ array: ARRAY [0..10] OF CARDINAL ;
+
+
+PROCEDURE Init ;
+VAR
+ i, n: CARDINAL ;
+BEGIN
+ array[0] := 10 ;
+ n := 0 ;
+ FOR i := 1 TO array[n] DO
+ END
+END Init ;
+
+
+BEGIN
+ Init
+END forarray.
diff --git a/gcc/testsuite/gm2/pim/pass/highbit.mod b/gcc/testsuite/gm2/pim/pass/highbit.mod
new file mode 100644
index 0000000..c9c872a
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/highbit.mod
@@ -0,0 +1,13 @@
+MODULE highbit ;
+
+FROM libc IMPORT printf ;
+
+TYPE
+ set = BITSET ;
+
+CONST
+ HighBit = MAX (set) ;
+
+BEGIN
+ printf ("the MAX (set) = %d\n", HighBit)
+END highbit.
diff --git a/gcc/testsuite/gm2/pim/pass/highbit2.mod b/gcc/testsuite/gm2/pim/pass/highbit2.mod
new file mode 100644
index 0000000..940556d
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/highbit2.mod
@@ -0,0 +1,13 @@
+MODULE highbit2 ;
+
+FROM libc IMPORT printf ;
+
+TYPE
+ set = BITSET ;
+
+CONST
+ HighBit = MAX (BITSET) ;
+
+BEGIN
+ printf ("the MAX (BITSET) = %d\n", HighBit)
+END highbit2.
diff --git a/gcc/testsuite/gm2/pim/pass/testxindr.mod b/gcc/testsuite/gm2/pim/pass/testxindr.mod
new file mode 100644
index 0000000..271f430
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/testxindr.mod
@@ -0,0 +1,17 @@
+MODULE testxindr ; (*!m2iso+gm2*)
+
+CONST
+ NulName = 0 ;
+
+TYPE
+ Name = CARDINAL ;
+
+ ptr = POINTER TO RECORD
+ n: Name ;
+ END ;
+
+VAR
+ p: ptr ;
+BEGIN
+ p^.n := NulName
+END testxindr.
diff --git a/gcc/testsuite/gm2/pim/pass/testxindr2.mod b/gcc/testsuite/gm2/pim/pass/testxindr2.mod
new file mode 100644
index 0000000..b0776dc
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/testxindr2.mod
@@ -0,0 +1,17 @@
+MODULE testxindr2 ; (*!m2iso+gm2*)
+
+CONST
+ NulName = 0 ;
+TYPE
+ Name = CARDINAL ;
+
+PROCEDURE set (VAR n: Name) ;
+BEGIN
+ n := NulName
+END set ;
+
+VAR
+ n: Name ;
+BEGIN
+ set (n)
+END testxindr2.
diff --git a/gcc/testsuite/gm2/pim/pass/testxindr3.mod b/gcc/testsuite/gm2/pim/pass/testxindr3.mod
new file mode 100644
index 0000000..5625c3e
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/pass/testxindr3.mod
@@ -0,0 +1,15 @@
+MODULE testxindr3 ; (*!m2iso+gm2*)
+
+CONST
+ NulName = 0 ;
+
+PROCEDURE set (VAR n: CARDINAL) ;
+BEGIN
+ n := NulName
+END set ;
+
+VAR
+ n: CARDINAL ;
+BEGIN
+ set (n)
+END testxindr3.