gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Mac OS X: FpuIOBug.mod Test


From: Michael Lambert
Subject: [Gm2] Mac OS X: FpuIOBug.mod Test
Date: Sat, 31 Dec 2005 21:35:32 -0500
User-agent: Thunderbird 1.5 (Macintosh/20051201)

The following will get rid of three more unexpected failures in the testing on Mac OS X 10.4.3. After my previous note on realbitscast.mod, this leaves just nine errors:

     pass/arrayhuge.mod
     pass/arrayhuge2.mod
     gm2-libs-pim/TimeDate.mod

The problem here is that LONGINT (and LONGCARD, for that matter) is only 32 bits on the Mac. The C type 'long long' is 64 bits long. This is also true for the gcc 4.0 compiler.

Both diffs below are in the testsuite/gm2/switches/pim4/run/pass directory. The change to gm2.exp could probably be made specific to the particular test (if I knew Tcl better!).

Michael

-----
% diff -u gm2.exp.sav gm2.exp
--- gm2.exp.sav 2005-11-22 06:09:18.000000000 -0500
+++ gm2.exp     2005-12-31 21:10:32.000000000 -0500
@@ -22,7 +22,7 @@
 # load support procs
 load_lib gm2-torture.exp

-gm2_init "-I$srcdir/../gm2/gm2-libs:$srcdir/../gm2/pim/pass:$srcdir/../gm2/gm2-compiler:../gm2/gm2-libs:../gm2/gm2-compiler" -Wpim4 +gm2_init "-I$srcdir/../gm2/gm2-libs:$srcdir/../gm2/pim/pass:$srcdir/../gm2/gm2-compiler:../gm2/gm2-libs:../gm2/gm2-compiler" -Wpim4 -Wcpp

 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
# If we're only testing specific files and this isn't one of them, skip it.
% diff -u FpuIOBug.mod.sav FpuIOBug.mod
--- FpuIOBug.mod.sav    2005-11-18 16:54:50.000000000 -0500
+++ FpuIOBug.mod        2005-12-31 20:40:44.000000000 -0500
@@ -56,19 +56,31 @@

    s := WriteLongInt(MAX(LONGINT), 0) ;
    r := printf('result of MAX(LONGINT) = %s\n', string(s)) ;
+#if defined(__ppc__)
+   Assert(EqualArray(s, '2147483647'), __FILE__, __LINE__,
+#else
    Assert(EqualArray(s, '9223372036854775807'), __FILE__, __LINE__,
+#endif
           'MAX(LONGINT) in LongIntegerToString') ;
    s := KillString(s) ;

    s := WriteLongInt(MIN(LONGINT), 0) ;
    r := printf('result of MIN(LONGINT) = %s\n', string(s)) ;
+#if defined(__ppc__)
+   Assert(EqualArray(s, '-2147483648'), __FILE__, __LINE__,
+#else
    Assert(EqualArray(s, '-9223372036854775808'), __FILE__, __LINE__,
+#endif
           'MIN(LONGINT) in LongIntegerToString') ;
    s := KillString(s) ;

    s := WriteLongInt(MIN(LONGINT)+1, 0) ;
    r := printf('result of MIN(LONGINT)+1 = %s\n', string(s)) ;
+#if defined(__ppc__)
+   Assert(EqualArray(s, '-2147483647'), __FILE__, __LINE__,
+#else
    Assert(EqualArray(s, '-9223372036854775807'), __FILE__, __LINE__,
+#endif
           'MIN(LONGINT)+1 in itos') ;
    s := KillString(s) ;
    exit(res)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]