Commit cd6e786a authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Marge Bot

Add test for #17648

parent 1bfd8259
Pipeline #15775 passed with stages
in 458 minutes and 48 seconds
......@@ -58,3 +58,20 @@ T15155l:
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O0 -ddump-llvm T15155l.hs 2>/dev/null \
| grep -F "= alias %T15155_" | grep -E "@T15155_[ab]_closure.def = " | grep -F "%T15155_a_closure_struct*" \
| wc -l | sed -e 's/ *//g' | grep "2"; echo $$?
# Without -fcatch-bottoms `f` is non-CAFFY. With -fcatch-bottoms it becomes
# CAFFY. Before CafInfo rework (c846618a) this used to cause incorrect CafInfo
# attached to `f` in the interface file.
T17648:
# -dno-typeable-binds is to make the iface simpler
# -O is necessary as otherwise we don't write interface pragmas (e.g.
# NoCafRefs) to the interface files.
'$(TEST_HC)' $(TEST_HC_OPTS) -dno-typeable-binds -O T17648.hs -v0
'$(TEST_HC)' --show-iface T17648.hi | tr -d '\n' | \
grep -F 'f :: T GHC.Types.Int -> () {- HasNoCafRefs, Arity' >/dev/null
# Second compilation with -fcatch-bottoms, f should be CAFFY
'$(TEST_HC)' $(TEST_HC_OPTS) -dno-typeable-binds -O \
-fcatch-bottoms T17648.hs -v0 -fforce-recomp
'$(TEST_HC)' --show-iface T17648.hi | tr -d '\n' | \
grep -F 'f :: T GHC.Types.Int -> () {- Arity: 1, Strictness' >/dev/null
{-# LANGUAGE GADTs #-}
module T17648 where
data T a where
A :: T Int
B :: T Bool
f :: T Int -> ()
f A = ()
......@@ -89,3 +89,5 @@ switch_skeleton_and_entries_only = ('grep -e "switch \[" -e "case " -e "default:
test('T14373d', [],
multimod_compile_filter, ['T14373d', '-fasm -O2 -c -ddump-cmm-from-stg',
switch_skeleton_and_entries_only])
test('T17648', normal, makefile_test, [])
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