gm2
[Top][All Lists]
Advanced

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

Re: Fixing testsuite failures: arithX.mod


From: Gaius Mulley
Subject: Re: Fixing testsuite failures: arithX.mod
Date: Mon, 10 May 2021 11:21:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hi Brian,

I've added some printfs to arith3.mod, on my machine I now see the
following output:

isode: ~gm2-savannah/gcc-versionno/gcc/testsuite/gm2/complex/run/pass
$ gm2 -fiso arith3.mod
isode: ~gm2-savannah/gcc-versionno/gcc/testsuite/gm2/complex/run/pass
$ ./a.out
main module starting
a := i
b := a*getOne()
c := i*i
Assert (c=-one)
Assert (i*i=-one)
main module finishing, all done

and here is the contents of the modified arith3.mod:

MODULE arith3 ;

FROM M2RTS IMPORT Halt ;
FROM libc IMPORT printf ;

CONST
   i    = CMPLX (0.0, 1.0) ;
   one  = CMPLX (1.0, 0.0) ;
   zero = CMPLX (0.0, 0.0) ;

PROCEDURE Assert (b: BOOLEAN; l: CARDINAL) ;
BEGIN
   IF NOT b
   THEN
      Halt(__FILE__, l, __FUNCTION__, 'failure')
   END
END Assert ;

PROCEDURE getOne () : COMPLEX ;
BEGIN
   RETURN one
END getOne ;

VAR
   a, b, c: COMPLEX ;
BEGIN
   printf ("main module starting\n");
   printf ("a := i\n");
   a := i ;
   printf ("b := a*getOne()\n");
   b := a*getOne() ;
   printf ("c := i*i\n");
   c := i*i ;

   printf ("Assert (c=-one)\n");
   Assert(c=-one, __LINE__) ;

   printf ("Assert (i*i=-one)\n");
   Assert(i*i=-one, __LINE__) ;
   printf ("main module finishing, all done\n");
END arith3.



regards,
Gaius



reply via email to

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