HPC gives spurious results if sources are compiled with -cpp

Dominic Steinitz dominic at steinitz.org
Tue Jul 14 05:08:46 EDT 2009


Trac doesn't seem to work for us so I'm sending this bug report by email.

ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.1

ghc.exe -fhpc -cpp --make CommonHPC.hs -o CommonHPC

commonHPC

hpc markup CommonHPC --fun-entry-count

This gives no entry counts for fact in Common.hs. With more complex modules, 
you get spurious red, yellow and green over expressions.

Dominic.

CommonHPC.hs:

module Main (main) where

import Common

main = do
  test
  test

test = do
  putStrLn $ show $ fact 4
  putStrLn $ show $ fact 5

Common.hs:

module Common (
               fact
)
where

fact 0 = 1
fact n = n * fact (n-1)





More information about the Glasgow-haskell-users mailing list