From: panne Date: Mon, 12 Jun 2000 18:15:18 +0000 (+0000) Subject: [project @ 2000-06-12 18:15:18 by panne] X-Git-Tag: Approximately_9120_patches~4269 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fb51d8a45cc22d84f6a6cf7689f6d2f725c6b848;p=ghc-hetmet.git [project @ 2000-06-12 18:15:18 by panne] Use "foreign label" instead of litlit for stdout. --- diff --git a/ghc/tests/codeGen/should_run/cg026.hs b/ghc/tests/codeGen/should_run/cg026.hs index 2600db5..4deaab9 100644 --- a/ghc/tests/codeGen/should_run/cg026.hs +++ b/ghc/tests/codeGen/should_run/cg026.hs @@ -3,6 +3,7 @@ module Main ( main ) where import PrelBase +import PrelAddr(indexAddrOffAddr) import ST import IOExts import ST @@ -27,13 +28,18 @@ main = putStr -- Arr# Char# ------------------------------------------- -- (main effort is in packString#) +foreign label "stdout" addrOfStdout :: Addr + +stdout :: Addr +stdout = indexAddrOffAddr addrOfStdout 0 + test_chars :: String test_chars = let str = reverse "Now is the time for all good men to come to...\n" in unsafePerformIO ( - _ccall_ fprintf (``stdout''::Addr) (packString "%d %s\n") (93::Int) (packString str) >> - _ccall_ fflush (``stdout''::Addr) >> + _ccall_ fprintf stdout (packString "%d %s\n") (93::Int) (packString str) >> + _ccall_ fflush stdout >> return "" )