From: simonpj Date: Mon, 26 Jun 2000 16:09:40 +0000 (+0000) Subject: [project @ 2000-06-26 16:09:40 by simonpj] X-Git-Tag: Approximately_9120_patches~4138 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f2ffb8f054fb2249ec69b34ccb00720fea7f1101;hp=a3effa29fb8022710931c5a98faea74f081daa9f;p=ghc-hetmet.git [project @ 2000-06-26 16:09:40 by simonpj] Add test for filterFB --- diff --git a/ghc/tests/simplCore/should_run/Makefile b/ghc/tests/simplCore/should_run/Makefile new file mode 100644 index 0000000..7ec3806 --- /dev/null +++ b/ghc/tests/simplCore/should_run/Makefile @@ -0,0 +1,9 @@ +TOP = ../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/should_run.mk + +SRC_HC_OPTS += -dcore-lint + +include $(TOP)/mk/target.mk + + diff --git a/ghc/tests/simplCore/should_run/simplrun001.hs b/ghc/tests/simplCore/should_run/simplrun001.hs new file mode 100644 index 0000000..f0b02c1 --- /dev/null +++ b/ghc/tests/simplCore/should_run/simplrun001.hs @@ -0,0 +1,16 @@ +{-# OPTIONS -O #-} + +-- !!! Test filter fusion + +-- In GHC 4.06, the filterFB rule was back to front, which +-- made this program hit the "error foo" case instead of +-- working fine. + + +module Main where + +main :: IO () +main = print (length (filter (not . foo) + (filter (const False) [Nothing]))) + where foo (Just x) = x + foo _ = error "foo" diff --git a/ghc/tests/simplCore/should_run/simplrun001.stderr b/ghc/tests/simplCore/should_run/simplrun001.stderr new file mode 100644 index 0000000..317bd0d --- /dev/null +++ b/ghc/tests/simplCore/should_run/simplrun001.stderr @@ -0,0 +1,2 @@ + +Fail: foo diff --git a/ghc/tests/simplCore/should_run/simplrun001.stdout b/ghc/tests/simplCore/should_run/simplrun001.stdout new file mode 100644 index 0000000..573541a --- /dev/null +++ b/ghc/tests/simplCore/should_run/simplrun001.stdout @@ -0,0 +1 @@ +0