Commit 6d0a38e4 authored by simonpj's avatar simonpj

[project @ 2004-02-06 15:12:31 by simonpj]

Add a codegen switch test
parent c7269061
......@@ -51,3 +51,4 @@ test('cg050', normal, compile_and_run, [''])
test('cg051', (compose (expect_fail_for(['extcore','optextcore']),exit_code(1))), compile_and_run, [''])
test('cg052', only_ways(['opt']), compile_and_run, ['-funbox-strict-fields'])
test('cg053', normal, compile_and_run, [''])
test('cg054', normal, compile_and_run, [''])
module Main where
data Y = X1 | X2 | X3 | X4 | X5 | X6 | X7 | X8
deriving( Show )
data X = WithY Y
| A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8
foo :: X -> Y
foo A1 = X1
foo A2 = X2
foo A3 = X3
foo A4 = X4
foo A5 = X5
foo A6 = X6
foo A7 = X7
foo A8 = X8
foo (WithY _) = X1
bar :: X -> Y
bar (WithY x) = x
bar y = foobar (foo y) -- The WithY case can't occur, and in an
-- earlier version that confused the code generator
{-# NOINLINE foobar #-}
foobar x = x
main = print (map bar [WithY X2, A4, A5])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment