-- Author: Simon Meier <iridcode@gmail.com>, 10/06/2010---- Attempt to find a small test-case for the segfaults that happen when-- compiling the benchmarks with LLVM and GHC-7.0.1--
module LlvmSegfault where
import Data.Word
import Data.Monoid
import qualified Data.ByteString.Lazy as L
import Foreign
import Blaze.ByteString.Builder.Internal
fromWord8 :: Word8 -> BuilderfromWord8w =
Builderstep
where
stepkpfpe
| pf<pe = do
pokepfw
let pf' = pf`plusPtr`1pf'`seq`kpf'pe
| otherwise = return$BufferFull1pf (stepk)
word8s :: Builderword8s = map (fromWord8.fromIntegral) $[(1::Int)..1000]main :: IO()main =
print$toLazyByteStringWith1010 (mconcatword8s) L.empty