]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/115164 initial test code highlighting the problem
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 21 May 2024 00:11:48 +0000 (01:11 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 21 May 2024 00:11:48 +0000 (01:11 +0100)
This patch includes some trivial testcode which highlights
PR 115164.  Expect future test code to perform runtime checks
for a series of trailing zeros.

gcc/testsuite/ChangeLog:

PR modula2/115164
* gm2/isolib/run/pass/testlowread.mod: New test.
* gm2/isolib/run/pass/testwritereal.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/testsuite/gm2/isolib/run/pass/testlowread.mod [new file with mode: 0644]
gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod [new file with mode: 0644]

diff --git a/gcc/testsuite/gm2/isolib/run/pass/testlowread.mod b/gcc/testsuite/gm2/isolib/run/pass/testlowread.mod
new file mode 100644 (file)
index 0000000..fefbcb0
--- /dev/null
@@ -0,0 +1,9 @@
+MODULE testlowread ;
+
+FROM LowReal IMPORT places ;
+FROM STextIO IMPORT WriteString, WriteLn ;
+FROM SWholeIO IMPORT WriteCard ;
+
+BEGIN
+   WriteString ('value of places = ') ; WriteCard (places, 0) ; WriteLn
+END testlowread.
diff --git a/gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod b/gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod
new file mode 100644 (file)
index 0000000..025d684
--- /dev/null
@@ -0,0 +1,9 @@
+MODULE testwritereal ;
+
+FROM STextIO IMPORT WriteString, WriteLn ;
+FROM SRealIO IMPORT WriteFloat ;
+FROM RealMath IMPORT pi ;
+
+BEGIN
+   WriteString ('value of pi = ') ; WriteFloat (pi, 0, 0) ; WriteLn
+END testwritereal.