Skip to content
GitLab
Menu
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
6a0aeca3
Commit
6a0aeca3
authored
Apr 03, 2009
by
simonpj
Browse files
Test Trac
#3118
parent
bf81cb80
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/simplCore/should_compile/T3118.hs
0 → 100644
View file @
6a0aeca3
-- Test Trac #3118
-- The test is quite delicate. It aims to get 'f' to look like
-- f y = case x of
-- Red -> (y, y)
-- _ -> let v = case x of
-- Green -> 2
-- Blue -> 3
-- in (v, 5)
--
-- And now float the inner case to top level
-- so that it's not so obvious that the Red case
-- cannot occur. This crashed GHC 6.10.
--
-- It's delicate to make the bug show up
-- (a) because it relies on not "seeing" that
-- x = Red until later.
-- (b) because dropping the Red case must happen
-- before float-out, which itself happens v early
-- In the original report, the x=Red was concealed by profiling
module
T3118
where
data
Colour
=
Red
|
Green
|
Blue
{-# NOINLINE [0] f #-}
g
x
=
Red
x
=
g
True
f
::
Int
->
(
Int
,
Int
)
f
y
=
case
x
of
Red
->
(
y
,
y
)
xx
->
let
v
=
case
xx
of
Red
->
1
Green
->
2
Blue
->
3
in
(
v
,
5
)
testsuite/tests/ghc-regress/simplCore/should_compile/all.T
View file @
6a0aeca3
...
...
@@ -36,4 +36,5 @@ test('spec003', normal, compile, [''])
test
('
rule1
',
normal
,
compile
,
[''])
test
('
strict-float
',
normal
,
compile
,
[''])
test
('
T3118
',
normal
,
compile
,
[''])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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