diff options
Diffstat (limited to 'testsuite/tests/deSugar/should_compile/ds035.hs')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/ds035.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_compile/ds035.hs b/testsuite/tests/deSugar/should_compile/ds035.hs new file mode 100644 index 0000000000..b3d8568a14 --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/ds035.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE MagicHash, BangPatterns #-} +module ShouldCompile where + +import GHC.Exts + +data CList = CNil | CCons Int# CList + +mk :: Int# -> CList +mk n = case (n ==# 0#) of + False -> CNil + _ -> CCons 1# (mk (n -# 1#)) + +clen :: CList -> Int# +clen CNil = 0# +clen (CCons _ cl) = 1# +# (clen cl) + +main = putStr (case len4_twice of + 8# -> "bingo\n" + _ -> "oops\n") + where + list4 = mk 4# + !len4 = clen list4 + !len4_twice = len4 +# len4 |