]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Check in some initial infrastructure for the dpas-based test suite.
authorRhys Weatherley <rweather@southern-storm.com.au>
Wed, 12 May 2004 01:11:17 +0000 (01:11 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Wed, 12 May 2004 01:11:17 +0000 (01:11 +0000)
ChangeLog
Makefile.am
configure.in
tests/.cvsignore [new file with mode: 0644]
tests/Makefile.am [new file with mode: 0644]
tests/coerce.pas [new file with mode: 0644]

index 9e82f76755615c7810af951a398006b61555dfc7..c965634e23d50451e0688d005dc044aa066d14c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * dpas/dpas-scanner.l (dpas_parse_hex): ignore the 'H' on the
        end of a hexadecimal constant.
 
+       * Makefile.am, configure.in, tests/.cvsignore, tests/Makefile.am,
+       tests/coerce.pas: check in some initial infrastructure for the
+       dpas-based test suite.
+
 2004-05-11  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * include/jit/jit-insn.h, jit/jit-insn.c, jit/jit-interp.cpp,
index bdd5ba58906979000de9c4b93be57a119234c039..baf1fc5b35772147f8fc1496cd1c4b1ee60c7146 100644 (file)
@@ -1,2 +1,2 @@
 
-SUBDIRS = include tools jit jitdynamic jitplus dpas tutorial doc
+SUBDIRS = include tools jit jitdynamic jitplus dpas tutorial tests doc
index 13895040278f9ef9dea2736b4758434698a448a7..1006389646a9a2aa4e02a28a7c1f6bf613aa0041 100644 (file)
@@ -397,4 +397,5 @@ jitdynamic/Makefile
 jitplus/Makefile
 dpas/Makefile
 tutorial/Makefile
+tests/Makefile
 doc/Makefile])
diff --git a/tests/.cvsignore b/tests/.cvsignore
new file mode 100644 (file)
index 0000000..6e5ca7e
--- /dev/null
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+.deps
+.libs
+*.lo
+*.la
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..c8e1bbd
--- /dev/null
@@ -0,0 +1,3 @@
+
+TESTS = coerce.pas
+TESTS_ENVIRONMENT = $(top_builddir)/dpas/dpas
diff --git a/tests/coerce.pas b/tests/coerce.pas
new file mode 100644 (file)
index 0000000..caf7e6f
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+ * coerce.pas - Test type coercion of the primitive operators.
+ *
+ * Copyright (C) 2004  Southern Storm Software, Pty Ltd.
+ *
+ * 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 2 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *)
+
+program coerce;
+
+var
+       failed: boolean;
+
+procedure run(msg: string; value: boolean);
+begin
+       Write(msg);
+       Write(" ... ");
+       if value then begin
+               WriteLn("ok");
+       end else begin
+               WriteLn("failed");
+               failed := True;
+       end;
+end;
+
+procedure run_tests;
+begin
+       run("coerce_int_int", SameType(Integer, 3 + 4));
+       run("coerce_int_uint", SameType(Integer, 3 + 0FFFFFFFFH));
+       run("coerce_uint_uint", SameType(Cardinal, 080000000H + 0FFFFFFFFH));
+       run("coerce_int_long", SameType(LongInt, 3 / 07FFFFFFFFFFFH));
+       run("coerce_long_int", SameType(LongInt, 07FFFFFFFFFFFH * 3));
+end;
+
+begin
+       failed := False;
+       run_tests;
+       if failed then begin
+               Terminate(1);
+       end;
+end.