From: sof Date: Mon, 26 May 1997 05:49:14 +0000 (+0000) Subject: [project @ 1997-05-26 05:48:07 by sof] X-Git-Tag: Approximately_1000_patches_recorded~458 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=34cb1a0464a3d370b3c2e9de2fb399b8fbfab8c7;p=ghc-hetmet.git [project @ 1997-05-26 05:48:07 by sof] Updated for 2.03 --- diff --git a/ghc/compiler/tests/simplCore/Makefile b/ghc/compiler/tests/simplCore/Makefile index 6f36b84..ee2596f 100644 --- a/ghc/compiler/tests/simplCore/Makefile +++ b/ghc/compiler/tests/simplCore/Makefile @@ -1,7 +1,16 @@ -TOP = ../../../.. -GhcRunTestRules = YES -# These options apply to all tests -RUNSTDTEST_OPTS = -noC -O -ddump-simpl -dcore-lint -include $(TOP)/ghc/mk/ghc.mk +TOP = ../../.. +include $(TOP)/mk/boilerplate.mk -runtests :: $(patsubst %.hs, %.runtest, $(wildcard *.hs)) +HS_SRCS = $(wildcard *.hs) + +SRC_RUNTEST_OPTS += -accept-output -o1 $*.stdout -o2 $*.stderr -x 0 +HC_OPTS += -noC -O -ddump-simpl -dcore-lint + +%.o : %.hs + +%.o : %.hs + $(RUNTEST) $(HC) $(RUNTEST_OPTS) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@)) + +all :: $(HS_OBJS) + +include $(TOP)/mk/target.mk diff --git a/ghc/compiler/tests/simplCore/simpl001.hs b/ghc/compiler/tests/simplCore/simpl001.hs index 79e00ec..c481365 100644 --- a/ghc/compiler/tests/simplCore/simpl001.hs +++ b/ghc/compiler/tests/simplCore/simpl001.hs @@ -3,6 +3,7 @@ -- only tickled by the simplifier -- type Foo a b = a -> (b -> a) -> b +module Test where (++++) :: (a -> (b -> a) -> b) -> (a -> (b -> a) -> b) -> a -> (b -> a) -> b x ++++ y = y diff --git a/ghc/compiler/tests/simplCore/simpl001.stderr b/ghc/compiler/tests/simplCore/simpl001.stderr index e69de29..b1ee08d 100644 --- a/ghc/compiler/tests/simplCore/simpl001.stderr +++ b/ghc/compiler/tests/simplCore/simpl001.stderr @@ -0,0 +1,111 @@ + + +================================================================================ +Simplified: +++++{-r3h,x-} :: + _forall_ + [a{-auX-} b{-auY-}] + => + (a{-auX-} -> (b{-auY-} -> a{-auX-}) -> b{-auY-}) + -> (a{-auX-} -> (b{-auY-} -> a{-auX-}) -> b{-auY-}) + -> a{-auX-} + -> (b{-auY-} -> a{-auX-}) + -> b{-auY-} +_A>_ 2 {-# L #-} +++++{-r3h,x-} = + _/\_ a{-sE8-} b{-sE9-} -> \ x_sDl :: + a{-sE8-} -> (b{-sE9-} -> a{-sE8-}) -> b{-sE9-} + {-# L #-} + x_sDl y_sCR :: + a{-sE8-} -> (b{-sE9-} -> a{-sE8-}) -> b{-sE9-} + {-# L #-} + y_sCR -> + y_sCR +g{-r3j,x-} :: + _forall_ + [a{-avh-} b{-avi-} rk0{-avq-}] + => + {PrelBase.Functor{-2b,p-} rk0{-avq-}} + -> (a{-avh-} -> (b{-avi-} -> a{-avh-}) -> b{-avi-}) + -> rk0{-avq-} (a{-avh-} -> (b{-avi-} -> a{-avh-}) -> b{-avi-}) + -> rk0{-avq-} (a{-avh-} -> (b{-avi-} -> a{-avh-}) -> b{-avi-}) +_A>_ 3 {-# L #-} +g{-r3j,x-} = + _/\_ a{-sEd-} b{-sEe-} rk0{-sEf-} -> \ d.Functor_sDp :: + {PrelBase.Functor{-2b,p-} rk0{-sEf-}} + {-# L #-} + d.Functor_sDp a_sDk :: + a{-sEd-} + -> (b{-sEe-} -> a{-sEd-}) + -> b{-sEe-} + {-# L #-} + a_sDk xs_sDV :: + rk0{-sEf-} (a{-sEd-} + -> (b{-sEe-} + -> a{-sEd-}) + -> b{-sEe-}) + {-# L #-} + xs_sDV -> + let { + ds_sDr :: + (a{-sEd-} -> (b{-sEe-} -> a{-sEd-}) -> b{-sEe-}) + -> a{-sEd-} + -> (b{-sEe-} -> a{-sEd-}) + -> b{-sEe-} + _A>_ 1 {-# L #-} + ds_sDr = + \ ds_sDq :: + a{-sEd-} -> (b{-sEe-} -> a{-sEd-}) -> b{-sEe-} + {-# L #-} + ds_sDq -> + a_sDk + } in + d.Functor_sDp + _@_ (a{-sEd-} -> (b{-sEe-} -> a{-sEd-}) -> b{-sEe-}) + _@_ (a{-sEd-} -> (b{-sEe-} -> a{-sEd-}) -> b{-sEe-}) + ds_sDr + xs_sDV +h{-r3i,x-} :: + _forall_ + [a{-avI-} b{-avK-} rk0{-avT-}] + => + {PrelBase.Functor{-2b,p-} rk0{-avT-}} + -> (a{-avI-} -> (b{-avK-} -> a{-avI-}) -> b{-avK-}) + -> rk0{-avT-} (a{-avI-} -> (b{-avK-} -> a{-avI-}) -> b{-avK-}) + -> rk0{-avT-} (a{-avI-} -> (b{-avK-} -> a{-avI-}) -> b{-avK-}) +_A>_ 3 {-# L #-} +h{-r3i,x-} = + _/\_ a{-sEl-} b{-sEm-} rk0{-sEn-} -> \ d.Functor_sDZ :: + {PrelBase.Functor{-2b,p-} rk0{-sEn-}} + {-# L #-} + d.Functor_sDZ b_sEg :: + a{-sEl-} + -> (b{-sEm-} -> a{-sEl-}) + -> b{-sEm-} + {-# L #-} + b_sEg xs_sEh :: + rk0{-sEn-} (a{-sEl-} + -> (b{-sEm-} + -> a{-sEl-}) + -> b{-sEm-}) + {-# L #-} + xs_sEh -> + let { + ds_sE0 :: + (a{-sEl-} -> (b{-sEm-} -> a{-sEl-}) -> b{-sEm-}) + -> a{-sEl-} + -> (b{-sEm-} -> a{-sEl-}) + -> b{-sEm-} + _A>_ 1 {-# L #-} + ds_sE0 = + \ ds_sDU :: + a{-sEl-} -> (b{-sEm-} -> a{-sEl-}) -> b{-sEm-} + {-# L #-} + ds_sDU -> + ds_sDU + } in + d.Functor_sDZ + _@_ (a{-sEl-} -> (b{-sEm-} -> a{-sEl-}) -> b{-sEm-}) + _@_ (a{-sEl-} -> (b{-sEm-} -> a{-sEl-}) -> b{-sEm-}) + ds_sE0 + xs_sEh diff --git a/ghc/compiler/tests/simplCore/simpl002.hs b/ghc/compiler/tests/simplCore/simpl002.hs index 206e861..578c13a 100644 --- a/ghc/compiler/tests/simplCore/simpl002.hs +++ b/ghc/compiler/tests/simplCore/simpl002.hs @@ -1,5 +1,6 @@ --!!! class/instance mumble that failed Lint at one time -- +module Test where class Foo a where op :: Int -> a -> Bool diff --git a/ghc/compiler/tests/simplCore/simpl002.stderr b/ghc/compiler/tests/simplCore/simpl002.stderr index e69de29..49ad874 100644 --- a/ghc/compiler/tests/simplCore/simpl002.stderr +++ b/ghc/compiler/tests/simplCore/simpl002.stderr @@ -0,0 +1,138 @@ + + +================================================================================ +Simplified: +nrlit_sMT :: + [PrelBase.Char{-38,p-}] +{-# L #-} +nrlit_sMT = + PackedString.unpackCString#{-8F,p-} + "xxx" +$d1{-rJ7,x-} :: + _forall_ + [a{-r3g-} b{-r3h-} c{-r3i-}] + => + {Foo{-r3j,x-} a{-r3g-}} + -> {Foo{-r3j,x-} b{-r3h-}} + -> {Foo{-r3j,x-} c{-r3i-}} + -> {Foo{-r3j,x-} (Wibble{-r3y,x-} a{-r3g-} b{-r3h-} c{-r3i-})} +_A>_ 3 {-# L #-} +$d1{-rJ7,x-} = + _/\_ a{-sMG-} b{-sMH-} c{-sMI-} -> \ d.Foo_sLN :: + {Foo{-r3j,x-} a{-sMG-}} + {-# L #-} + d.Foo_sLN d.Foo_sLM :: + {Foo{-r3j,x-} b{-sMH-}} + {-# L #-} + d.Foo_sLM d.Foo_sLL :: + {Foo{-r3j,x-} c{-sMI-}} + {-# L #-} + d.Foo_sLL -> + let { + op_sLp :: + PrelBase.Int{-3g,p-} + -> Wibble{-r3y,x-} a{-sMG-} b{-sMH-} c{-sMI-} + -> PrelBase.Bool{-34,p-} + _A>_ 2 {-# L #-} + op_sLp = + \ x_sLs :: + PrelBase.Int{-3g,p-} + {-# L #-} + x_sLs y_sLq :: + Wibble{-r3y,x-} a{-sMG-} b{-sMH-} c{-sMI-} + {-# L #-} + y_sLq -> + IOBase.error{-87,p-} + _@_ PrelBase.Bool{-34,p-} nrlit_sMT } in + let { + op_sLO :: + PrelBase.Int{-3g,p-} + -> Wibble{-r3y,x-} a{-sMG-} b{-sMH-} c{-sMI-} + -> PrelBase.Bool{-34,p-} + _A>_ 2 {-# L #-} + op_sLO = + op_sLp } in + let { + d.Foo_sLP :: + {Foo{-r3j,x-} (Wibble{-r3y,x-} a{-sMG-} b{-sMH-} c{-sMI-})} + _A>_ 2 {-# L #-} + d.Foo_sLP = + op_sLp + } in + op_sLp +$d2{-rJ2,x-} :: + _forall_ + [a{-r3s-} b{-r3t-} c{-r3u-}] + => + {PrelBase.Eval{-24,p-} (Wibble{-r3y,x-} a{-r3s-} b{-r3t-} c{-r3u-})} +_A>_ 0 {-# L #-} +$d2{-rJ2,x-} = + _/\_ a{-sMV-} b{-sMW-} c{-sMX-} -> + let { + d.Eval_sM2 :: + {PrelBase.Eval{-24,p-} (Wibble{-r3y,x-} a{-sMV-} b{-sMW-} c{-sMX-})} + {-# L #-} + d.Eval_sM2 = + PrelBase.void{-8G,p-} + } in + PrelBase.void{-8G,p-} +nrlit_sMU :: + [PrelBase.Char{-38,p-}] +{-# L #-} +nrlit_sMU = + PackedString.unpackCString#{-8F,p-} + "Class Foo Method op" +$mop{-rIV,x-} :: + _forall_ + [a{-r3w-}] + => + {Foo{-r3j,x-} a{-r3w-}} + -> PrelBase.Int{-3g,p-} + -> a{-r3w-} + -> PrelBase.Bool{-34,p-} +_A>_ 3 {-# L #-} +$mop{-rIV,x-} = + _/\_ a{-sMJ-} -> \ d.Foo_sMg :: + {Foo{-r3j,x-} a{-sMJ-}} + {-# L #-} + d.Foo_sMg -> + GHCerr.noDefaultMethodError{-8k,p-} + _@_ (PrelBase.Int{-3g,p-} -> a{-sMJ-} -> PrelBase.Bool{-34,p-}) + nrlit_sMU +op{-r3z,x-} :: + _forall_ + [a{-r3w-}] + => + {Foo{-r3j,x-} a{-r3w-}} + -> PrelBase.Int{-3g,p-} + -> a{-r3w-} + -> PrelBase.Bool{-34,p-} +_A>_ 1 {-# L #-} +op{-r3z,x-} = + _/\_ a{-sMK-} -> \ tpl_sMf :: + {Foo{-r3j,x-} a{-sMK-}} + {-# L #-} + tpl_sMf -> + tpl_sMf +MkWibble{-r3x,x-}{i} :: + _forall_ + [a{-r3s-} b{-r3t-} c{-r3u-}] + => + a{-r3s-} + -> b{-r3t-} + -> c{-r3u-} + -> Wibble{-r3y,x-} a{-r3s-} b{-r3t-} c{-r3u-} +_A>_ 3 {-# L #-} +MkWibble{-r3x,x-}{i} = + _/\_ a{-sMO-} b{-sMP-} c{-sMQ-} -> \ tpl_sML :: + a{-sMO-} + {-# L #-} + tpl_sML tpl_sMM :: + b{-sMP-} + {-# L #-} + tpl_sMM tpl_sMN :: + c{-sMQ-} + {-# L #-} + tpl_sMN -> + MkWibble{-r3x,x-}{i} + {_@_ a{-sMO-} _@_ b{-sMP-} _@_ c{-sMQ-} tpl_sML tpl_sMM tpl_sMN} diff --git a/ghc/compiler/tests/stranal/default.lhs b/ghc/compiler/tests/stranal/default.lhs index 010e8d5..8557aa6 100644 --- a/ghc/compiler/tests/stranal/default.lhs +++ b/ghc/compiler/tests/stranal/default.lhs @@ -1,3 +1,4 @@ +> module Test where > data Boolean = FF | TT > data Pair a b = MkPair a b > data LList alpha = Nill | Conss alpha (LList alpha) diff --git a/ghc/compiler/tests/stranal/fact.lhs b/ghc/compiler/tests/stranal/fact.lhs index 2507c6b..20b2256 100644 --- a/ghc/compiler/tests/stranal/fact.lhs +++ b/ghc/compiler/tests/stranal/fact.lhs @@ -1,2 +1,3 @@ +> module Test where > fact :: Int -> Int > fact n = if n==0 then 2 else (fact n) * n diff --git a/ghc/compiler/tests/stranal/fun.lhs b/ghc/compiler/tests/stranal/fun.lhs index d86208b..8ab0832 100644 --- a/ghc/compiler/tests/stranal/fun.lhs +++ b/ghc/compiler/tests/stranal/fun.lhs @@ -1,3 +1,4 @@ +> module Test where > data Fun = MkFun (Fun -> Fun) > data LList a = Nill | Conss a (LList a) diff --git a/ghc/compiler/tests/stranal/goo.lhs b/ghc/compiler/tests/stranal/goo.lhs index ddf666b..c58b998 100644 --- a/ghc/compiler/tests/stranal/goo.lhs +++ b/ghc/compiler/tests/stranal/goo.lhs @@ -1,3 +1,4 @@ +> module Test where > data Goo a = Gsimpl | Gcompl ([Goo a]) > data Moo a b = Msimple | Mcompl (Moo b a) diff --git a/ghc/compiler/tests/stranal/ins.lhs b/ghc/compiler/tests/stranal/ins.lhs index 120b46f..71f8ce2 100644 --- a/ghc/compiler/tests/stranal/ins.lhs +++ b/ghc/compiler/tests/stranal/ins.lhs @@ -1,6 +1,7 @@ TEST OF DEFACTORISATION FOR FUNCTIONS THAT DROP POLYMORPHIC VARIABLES +> module Test where > data Boolean = FF | TT > data Pair a b = MkPair a b > data LList alpha = Nill | Conss alpha (LList alpha) diff --git a/ghc/compiler/tests/stranal/map.lhs b/ghc/compiler/tests/stranal/map.lhs index d79ec03..343e36a 100644 --- a/ghc/compiler/tests/stranal/map.lhs +++ b/ghc/compiler/tests/stranal/map.lhs @@ -1,3 +1,4 @@ +> module Test where > data Boolean = FF | TT > data Pair a b = MkPair a b > data LList alpha = Nill | Conss alpha (LList alpha) diff --git a/ghc/compiler/tests/stranal/moo.lhs b/ghc/compiler/tests/stranal/moo.lhs index 3d6226b..35967ba 100644 --- a/ghc/compiler/tests/stranal/moo.lhs +++ b/ghc/compiler/tests/stranal/moo.lhs @@ -1,3 +1,4 @@ +> module Test where > data Moo a b = Msimple | Mcompl (Moo b a) diff --git a/ghc/compiler/tests/stranal/sim.lhs b/ghc/compiler/tests/stranal/sim.lhs index c788681..6c52104 100644 --- a/ghc/compiler/tests/stranal/sim.lhs +++ b/ghc/compiler/tests/stranal/sim.lhs @@ -1,3 +1,4 @@ +> module Test where > data Boolean = FF | TT > data Pair a b = MkPair a b > data LList alpha = Nill | Conss alpha (LList alpha) diff --git a/ghc/compiler/tests/stranal/syn.lhs b/ghc/compiler/tests/stranal/syn.lhs index 00da926..59d6bac 100644 --- a/ghc/compiler/tests/stranal/syn.lhs +++ b/ghc/compiler/tests/stranal/syn.lhs @@ -1,5 +1,6 @@ THIS TEST IS FOR TYPE SYNONIMS AND FACTORISATION IN THEIR PRESENCE. +> module Test where > data M a = A | B a (M a) > data L a = N | C a (Syn a) > type Syn b = L b diff --git a/ghc/compiler/tests/stranal/test.lhs b/ghc/compiler/tests/stranal/test.lhs index d1e1925..f89509a 100644 --- a/ghc/compiler/tests/stranal/test.lhs +++ b/ghc/compiler/tests/stranal/test.lhs @@ -1,3 +1,4 @@ +> module Test where > data LList t = Nill | Conss t (LList t) > data BBool = TTrue | FFalse diff --git a/ghc/compiler/tests/stranal/tst.lhs b/ghc/compiler/tests/stranal/tst.lhs index 5353935..edaf20d 100644 --- a/ghc/compiler/tests/stranal/tst.lhs +++ b/ghc/compiler/tests/stranal/tst.lhs @@ -1,2 +1,3 @@ +> module Test where > a :: [a] -> [[a]] > a x = [x] diff --git a/ghc/compiler/tests/stranal/unu.lhs b/ghc/compiler/tests/stranal/unu.lhs index 3932285..da6370c 100644 --- a/ghc/compiler/tests/stranal/unu.lhs +++ b/ghc/compiler/tests/stranal/unu.lhs @@ -1,3 +1,4 @@ +> module Test where > data Boolean = FF | TT > data Pair a b = Mkpair a b > data LList alpha = Nill | Conss alpha (LList alpha)