Commit 7fc20b02 authored by Facundo Domínguez's avatar Facundo Domínguez

Have Core linter accept programs using StaticPointers and -fhpc.

Summary:
This patch uses collectArgsTicks instead of collectArgs to test that
StaticPtr only occurs at the top of RHSs of top-level expressions.

Ticks introduced by -fhpc would interfere otherwise.

Test Plan: ./validate

Reviewers: thomie, austin, goldfire, bgamari, simonpj

Reviewed By: simonpj

Differential Revision: https://phabricator.haskell.org/D2355

GHC Trac Issues: #12207
parent 2f8cd14f
......@@ -552,7 +552,7 @@ lintRhs :: CoreExpr -> LintM OutType
-- but produce errors otherwise.
lintRhs rhs
| (binders0, rhs') <- collectTyBinders rhs
, (fun@(Var b), args) <- collectArgs rhs'
, (fun@(Var b), args, _) <- collectArgsTicks (const True) rhs'
, Just con <- isDataConId_maybe b
, dataConName con == staticPtrDataConName
, length args == 5
......
......@@ -421,8 +421,8 @@ test('T8474', normal, compile, [''])
test('T8563', normal, compile, [''])
test('T8565', normal, compile, [''])
test('T8644', normal, compile, [''])
test('TcStaticPointers01', expect_broken_for(12207, ['hpc']), compile, [''])
test('TcStaticPointers02', expect_broken_for(12207, ['hpc']), compile, [''])
test('TcStaticPointers01', normal, compile, [''])
test('TcStaticPointers02', normal, compile, [''])
test('T8762', normal, compile, [''])
test('MutRec', normal, compile, [''])
test('T8856', normal, compile, [''])
......
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