Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
34cb1a04
Commit
34cb1a04
authored
May 26, 1997
by
sof
Browse files
[project @ 1997-05-26 05:48:07 by sof]
Updated for 2.03
parent
0e703316
Changes
17
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/tests/simplCore/Makefile
View file @
34cb1a04
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
ghc/compiler/tests/simplCore/simpl001.hs
View file @
34cb1a04
...
...
@@ -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
...
...
ghc/compiler/tests/simplCore/simpl001.stderr
View file @
34cb1a04
================================================================================
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
ghc/compiler/tests/simplCore/simpl002.hs
View file @
34cb1a04
--!!!
class
/
instance
mumble
that
failed
Lint
at
one
time
--
module
Test
where
class
Foo
a
where
op
::
Int
->
a
->
Bool
...
...
ghc/compiler/tests/simplCore/simpl002.stderr
View file @
34cb1a04
================================================================================
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}
ghc/compiler/tests/stranal/default.lhs
View file @
34cb1a04
> module Test where
> data Boolean = FF | TT
> data Pair a b = MkPair a b
> data LList alpha = Nill | Conss alpha (LList alpha)
...
...
ghc/compiler/tests/stranal/fact.lhs
View file @
34cb1a04
> module Test where
> fact :: Int -> Int
> fact n = if n==0 then 2 else (fact n) * n
ghc/compiler/tests/stranal/fun.lhs
View file @
34cb1a04
> module Test where
> data Fun = MkFun (Fun -> Fun)
> data LList a = Nill | Conss a (LList a)
...
...
ghc/compiler/tests/stranal/goo.lhs
View file @
34cb1a04
> module Test where
> data Goo a = Gsimpl | Gcompl ([Goo a])
> data Moo a b = Msimple | Mcompl (Moo b a)
...
...
ghc/compiler/tests/stranal/ins.lhs
View file @
34cb1a04
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
)
...
...
ghc/compiler/tests/stranal/map.lhs
View file @
34cb1a04
> module Test where
> data Boolean = FF | TT
> data Pair a b = MkPair a b
> data LList alpha = Nill | Conss alpha (LList alpha)
...
...
ghc/compiler/tests/stranal/moo.lhs
View file @
34cb1a04
> module Test where
> data Moo a b = Msimple | Mcompl (Moo b a)
...
...
ghc/compiler/tests/stranal/sim.lhs
View file @
34cb1a04
> module Test where
> data Boolean = FF | TT
> data Pair a b = MkPair a b
> data LList alpha = Nill | Conss alpha (LList alpha)
...
...
ghc/compiler/tests/stranal/syn.lhs
View file @
34cb1a04
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
...
...
ghc/compiler/tests/stranal/test.lhs
View file @
34cb1a04
> module Test where
> data LList t = Nill | Conss t (LList t)
> data BBool = TTrue | FFalse
...
...
ghc/compiler/tests/stranal/tst.lhs
View file @
34cb1a04
> module Test where
> a :: [a] -> [[a]]
> a x = [x]
ghc/compiler/tests/stranal/unu.lhs
View file @
34cb1a04
> module Test where
> data Boolean = FF | TT
> data Pair a b = Mkpair a b
> data LList alpha = Nill | Conss alpha (LList alpha)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment