[M3devel] Open CM3 regression tests
Jay
jayk123 at hotmail.com
Sun Jan 27 21:44:52 CET 2008
Yes.
C:\dev2\cm3.2\m3-sys\m3tests\src\p1\p155\Main.m3
(* Copyright (C) 1994, Digital Equipment Corporation. *)(* All rights reserved. *)(* See the file COPYRIGHT for a full description. *) (* Last modified on Tue Oct 27 14:49:19 PST 1992 by kalsow *)(* modified on Wed Oct 10 13:15:01 1990 by saxe *)
(* Set operators on a small set type. *)
MODULE Main;IMPORT Test, Wr;FROM Stdio IMPORT stderr;
TYPE Elt = {a, b, c, d, e}; Set = SET OF Elt;
VAR x: Set;
CONST p = Set{Elt.a, Elt.c, Elt.e}; q = Set{}; r = Set{Elt.a .. Elt.b, Elt.a .. Elt.a (* , Elt.d .. Elt.b *)};
PROCEDURE m( s: TEXT ) = BEGIN TRY Wr.PutText (stderr, s & "\n"); Wr.Flush (stderr); EXCEPT ELSE END; END m;
BEGIN m ("check set p = {a, c, e}"); Test.checkM (Elt.a IN p, "Elt.a IN p"); Test.checkM (NOT (Elt.b IN p), "NOT (Elt.b IN p)"); Test.checkM (Elt.c IN p, "Elt.c IN p"); Test.checkM (NOT (Elt.d IN p), "NOT (Elt.d IN p)"); Test.checkM (Elt.e IN p, "(Elt.e IN p");
m ("check set q = {}"); Test.checkM (NOT (Elt.a IN q), "NOT (Elt.a IN q)"); Test.checkM (NOT (Elt.b IN q), "NOT (Elt.b IN q)"); Test.checkM (NOT (Elt.c IN q), "NOT (Elt.c IN q)"); Test.checkM (NOT (Elt.d IN q), "NOT (Elt.d IN q)"); Test.checkM (NOT (Elt.e IN q), "NOT (Elt.e IN q)");
m ("check set r = {a, b}"); Test.checkM (Elt.a IN r, "Elt.a IN r"); Test.checkM (Elt.b IN r, "Elt.b IN r"); Test.checkM (NOT (Elt.c IN r), "NOT (Elt.c IN r)"); Test.checkM (NOT (Elt.d IN r), "NOT (Elt.d IN r)"); Test.checkM (NOT (Elt.e IN r), "NOT (Elt.e IN r)");
Test.checkM (r = Set{Elt.b, Elt.a}, "r = Set{Elt.b, Elt.a}");
(** Test.checkM (-p = Set{Elt.d, Elt.b}); **) (** Test.checkM (+p = p); **) Test.checkM (p - p = q, "check (p - p = q)"); Test.checkM ((p - r) * (r - p) = q, "check ((p - r) * (r - p) = q)"); Test.checkM (p - r = Set{Elt.c, Elt.e}, "check (p - r = Set{Elt.c, Elt.e})"); Test.checkM (p + p = p, "check (p + p = p)"); Test.checkM (p + r = Set{Elt.a, Elt.b, Elt.c, Elt.e}, "check (p + r = Set{Elt.a, Elt.b, Elt.c, Elt.e})"); (** Test.checkM (-(-(r)) = r); **) Test.checkM (p * r = Set{Elt.a}, "check (p * r = Set{Elt.a})"); Test.checkM (p * q = Set{}, "check (p * q = Set{})"); Test.checkM (p # q, "check (p # q)"); Test.checkM (q < p, "check (q < p)"); Test.checkM (NOT (p < r), "check (NOT (p < r))"); Test.checkM (NOT (p > r), "check (NOT (p > r))"); Test.checkM (NOT (p = r), "check (NOT (p = r))"); Test.checkM ((p / r) = (Set{Elt.b, Elt.c, Elt.e}), "check ((p / r) = (Set{Elt.b, Elt.c, Elt.e}))"); Test.checkM (r / q = q / r, "check (r / q = q / r)"); Test.checkM (r / p / r / p / q / r = r, "check (r / p / r / p / q / r = r)"); Test.checkM (p / r - r / p = q, "check (p / r - r / p = q)"); x := p; x := x + Set{Elt.b}; (*INCL(x, Elt.b);*) (* x = { a, b, c, e } *) Test.checkM (x > p, "check (x > p)"); Test.checkM (x >= p, "check (x >= p)"); Test.checkM (p <= x, "check (p <= x)"); Test.checkM (p # x, "check (p # x)"); x := x - Set{Elt.c}; (*EXCL(x, Elt.c);*) (* x = { a, b, e } *) m ("check set x = {a, b, e}"); Test.checkM (Elt.a IN x, "Elt.a IN x"); Test.checkM (Elt.b IN x, "Elt.b IN x"); Test.checkM (NOT (Elt.c IN x), "NOT (Elt.c IN x)"); Test.checkM (NOT (Elt.d IN x), "NOT (Elt.d IN x)"); Test.checkM (Elt.e IN x, "Elt.e IN x"); Test.checkM (NOT (p <= x), "check (NOT (p <= x))"); Test.checkM (NOT (p >= x), "check (NOT (p >= x))"); Test.checkM (x = r + Set{Elt.e}, "check (x = r + Set{Elt.e})"); Test.done ();END Main. -Jay
> From: hosking at cs.purdue.edu> Date: Sun, 27 Jan 2008 15:33:34 -0500> To: wagner at elegosoft.com> CC: m3devel at elegosoft.com> Subject: Re: [M3devel] Open CM3 regression tests> > Are your sets larger than a single word? The M3 frontend compiles > small sets (elements <= BITSIZE(Word.T)) differently from large > (elements > BITSIZE(Word.T)). The out-of-line set operations are > only for large sets.> > > On Jan 27, 2008, at 12:55 PM, Olaf Wagner wrote:> > > Quoting Tony Hosking <hosking at cs.purdue.edu>:> >> >> The set operations are coded in cm3/m3-libs/m3core/src/Csupport/ > >> Common/hand.c.> >>> >> I notice Jay has made a number of changes here since September -- I> >> wonder if they have broken something.> >> > I tried different revisions of this file with no difference in the> > test results. I then took the latest version and added some printfs,> > and they got never displayed. So I checked what gets linked, but the> > symbols in question don't occur in the test program:> >> > % nm hand.o> > U __divdi3> > U __moddi3> > 000001e0 R _highbits> > 00000140 R _lowbits> > 00000000 T m3_div> > 000000ac T m3_divL> > 000001d4 T m3_mod> > 0000026c T m3_modL> > U printf> > 00000494 T set_difference> > 00000554 T set_eq> > 0000061c T set_ge> > 000006ac T set_gt> > 00000434 T set_intersection> > 0000077c T set_le> > 0000080c T set_lt> > 000003a8 T set_member> > 000005b8 T set_ne> > 000008d8 T set_range> > 000009d8 T set_singleton> > 000004f4 T set_sym_difference> > 000003d4 T set_union> >> > % nm /usr/local/cm3/pkg/m3core/FreeBSD4/libm3core.so.5 | grep set_> > 000243d0 T set_difference> > 00024490 T set_eq> > 00024558 T set_ge> > 000245fc T set_gt> > 00024370 T set_intersection> > 000246e0 T set_le> > 00024784 T set_lt> > 000242e4 T set_member> > 000244f4 T set_ne> > 00024864 T set_range> > 00024998 T set_singleton> > 00024430 T set_sym_difference> > 00024310 T set_union> >> > % ldd FreeBSD4/p1/p155/FreeBSD4/pgm> > FreeBSD4/p1/p155/FreeBSD4/pgm:> > libtest.so.5 => /d/home/wagner/work/cm3/m3-sys/m3tests/ > > FreeBSD4/libtest.so.5 (0x28085000)> > libm3.so.5 => /usr/local/cm3/pkg/libm3/FreeBSD4/libm3.so.5 > > (0x28088000)> > libm3core.so.5 => /usr/local/cm3/pkg/m3core/FreeBSD4/ > > libm3core.so.5 (0x281aa000)> > libm.so.4 => /lib/libm.so.4 (0x28a2d000)> > libpthread.so.2 => /lib/libpthread.so.2 (0x28a46000)> > libc.so.6 => /lib/libc.so.6 (0x28a6a000)> >> > % nm /usr/local/cm3/pkg/m3core/FreeBSD4/libm3core.so.5 | grep set_> > 000243d0 T set_difference> > 00024490 T set_eq> > 00024558 T set_ge> > 000245fc T set_gt> > 00024370 T set_intersection> > 000246e0 T set_le> > 00024784 T set_lt> > 000242e4 T set_member> > 000244f4 T set_ne> > 00024864 T set_range> > 00024998 T set_singleton> > 00024430 T set_sym_difference> > 00024310 T set_union> > luthien [~/work/cm3/m3-sys/m3tests] wagner> > % ldd FreeBSD4/p1/p155/FreeBSD4/pgm> > FreeBSD4/p1/p155/FreeBSD4/pgm:> > libtest.so.5 => /d/home/wagner/work/cm3/m3-sys/m3tests/ > > FreeBSD4/libtest.so.5 (0x28085000)> > libm3.so.5 => /usr/local/cm3/pkg/libm3/FreeBSD4/libm3.so.5 > > (0x28088000)> > libm3core.so.5 => /usr/local/cm3/pkg/m3core/FreeBSD4/ > > libm3core.so.5 (0x281aa000)> > libm.so.4 => /lib/libm.so.4 (0x28a2d000)> > libpthread.so.2 => /lib/libpthread.so.2 (0x28a46000)> > libc.so.6 => /lib/libc.so.6 (0x28a6a000)> > luthien [~/work/cm3/m3-sys/m3tests] wagner> > % nm -C -u FreeBSD4/p1/p155/FreeBSD4/pgm> > U Main_I3> > U RTHooks_I3> > U RTHooks__CheckLoadTracedRef> > U RTHooks__Concat> > U RTHooks__PopEFrame> > U RTHooks__PushEFrame> > U RTHooks__TextLitGetChar> > U RTHooks__TextLitGetChars> > U RTHooks__TextLitGetWideChar> > U RTHooks__TextLitGetWideChars> > U RTHooks__TextLitInfo> > U RTLinker__AddUnit> > U RTLinker__InitRuntime> > U RTProcess__Exit> > U Stdio_I3> > U Test_I3> > U Test__checkM> > U Test__done> > U Wr_I3> > U Wr__Flush> > U Wr__PutText> > w _Jv_RegisterClasses> > w __deregister_frame_info> > w __register_frame_info> > U _init_tls> > U _setjmp> > U atexit> > U exit> >> > Now I'm rather confused 8-/> >> > Any ideas?> >> > Olaf> > -- > > Olaf Wagner -- elego Software Solutions GmbH> > Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, > > Germany> > phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 > > 45 86 95> > http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: > > Berlin> > Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: > > DE163214194> >>
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080127/2f42ac14/attachment-0002.html>
More information about the M3devel
mailing list