diff options
author | panne <unknown> | 2000-06-12 18:15:18 +0000 |
---|---|---|
committer | panne <unknown> | 2000-06-12 18:15:18 +0000 |
commit | fb51d8a45cc22d84f6a6cf7689f6d2f725c6b848 (patch) | |
tree | d66056d6f876b10170643e86ba7fdc845b59aee9 /ghc/tests | |
parent | 92a2a3c2b433813e79c9a59f3b44a931b758ae2c (diff) | |
download | haskell-fb51d8a45cc22d84f6a6cf7689f6d2f725c6b848.tar.gz |
[project @ 2000-06-12 18:15:18 by panne]
Use "foreign label" instead of litlit for stdout.
Diffstat (limited to 'ghc/tests')
-rw-r--r-- | ghc/tests/codeGen/should_run/cg026.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ghc/tests/codeGen/should_run/cg026.hs b/ghc/tests/codeGen/should_run/cg026.hs index 2600db5e1e..4deaab935a 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 "" ) |