PPC Mac OS X validate: Unexpected failures: derefnull(normal) and divbyzero (normal)

Ian Lynagh igloo at earth.li
Sun Aug 12 15:06:29 EDT 2007


On Sun, Aug 12, 2007 at 07:15:17PM +0200, Thorkil Naur wrote:
> On Saturday 11 August 2007 19:54, Clemens Fruhwirth wrote:
> > At Sat, 11 Aug 2007 17:00:47 +0200,
> > Thorkil Naur <naur at post11.tele.dk> wrote:
> > > 
> > > Running validate on a PPC Mac OS X with the current (2007-08-11) HEAD 
> > > produces:
> 
> > =====> derefnull(normal)

This test is now fixed; thanks for the report.

> > =====> divbyzero(normal)
> > cd . && 
> '/Users/thorkilnaur/tn/GHCDarcsRepository/ghc-HEAD-complete-for-pulling-and-copying-20070713_1212/ghc/compiler/stage1/ghc-inplace' 
> -no-recomp -dcore-lint -dcmm-lint -Dpowerpc_apple_darwin  -o divbyzero 
> divbyzero.hs    >divbyzero.comp.stderr 2>&1
> > cd . && ./divbyzero    </dev/null >divbyzero.run.stdout 
> 2>divbyzero.run.stderr
> > Wrong exit code (expected 136 , actual 0 )
> > Stdout:
> > 0

The code is

    module Main where

    import GHC.Base

    main :: IO ()
    main = print (5 `divInt` 0)

so it seems that on PPC OS X (at least) we think 5/0 = 0.

Can you find out what

    #include <stdio.h>

    int main(void) {
        printf("%d", 5/0);
        return 0;
    }

does when compiled and run by gcc, and what it's exit code is, please?


Thanks
Ian



More information about the Cvs-ghc mailing list