Commit 0cb1b0e3 authored by simonpj's avatar simonpj
Browse files

Test Trac #4201 (eta reduction)

parent 33720956
...@@ -17,3 +17,8 @@ T4306: ...@@ -17,3 +17,8 @@ T4306:
'$(TEST_HC)' -c -O T4306.hs '$(TEST_HC)' -c -O T4306.hs
'$(TEST_HC)' --show-iface T4306.hi | grep 'wupd ::' '$(TEST_HC)' --show-iface T4306.hi | grep 'wupd ::'
T4201:
$(RM) -f rm -f T4201.hi T4201.o
'$(TEST_HC)' -c -O T4201.hs
'$(TEST_HC)' --show-iface T4201.hi | grep 'Unfolding.*sym'
module Eta where
data T = MkT
newtype Foo = Foo T
lift :: Foo -> T
lift (Foo x) = bof x
-- The point is that we expect
-- lift = bof |> co
-- not
-- lift = \fx -> bof (fx |> co)
bof :: T -> T
{-# NOINLINE bof #-}
bof MkT = MkT
Unfolding: (Eta.bof `cast` (sym Eta.NTCo:Foo -> Eta.T)) -}
...@@ -73,6 +73,11 @@ test('T4306', ...@@ -73,6 +73,11 @@ test('T4306',
run_command, run_command,
['$MAKE -s --no-print-directory T4306']) ['$MAKE -s --no-print-directory T4306'])
test('T4201',
normal,
run_command,
['$MAKE -s --no-print-directory T4201'])
test('T3772', test('T3772',
# only_ways(['optc','optasm']), # only_ways(['optc','optasm']),
extra_clean(['T3772_A.hi', 'T3772_A.o']), extra_clean(['T3772_A.hi', 'T3772_A.o']),
......
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