diff --git a/ghc/tests/codeGen/should_run/cg015.hs b/ghc/tests/codeGen/should_run/cg015.hs index 9c0f07b0ab1b7ee13ab9b1a755d393f59fd359ab..dab67e59b20ab050bc68e2e0d47109489974c156 100644 --- a/ghc/tests/codeGen/should_run/cg015.hs +++ b/ghc/tests/codeGen/should_run/cg015.hs @@ -1,6 +1,5 @@ -module GHCmain ( mainPrimIO ) where +module GHCmain ( mainIO ) where -import GlaExts import PrelBase data CList = CNil | CCons Int# CList @@ -14,7 +13,7 @@ clen :: CList -> Int# clen CNil = 0# clen (CCons _ cl) = 1# +# (clen cl) -mainPrimIO = case (clen list4) of +mainIO = case (clen list4) of len4 -> case (len4 +# len4) of 8# -> finish 65# -- 'A' @@ -22,5 +21,5 @@ mainPrimIO = case (clen list4) of where list4 = mk 4# -finish :: Int# -> PrimIO () -finish n = _ccall_ putchar (C# (chr# n)) `seqPrimIO` returnPrimIO () +finish :: Int# -> IO () +finish n = _ccall_ putchar (C# (chr# n)) >> return () diff --git a/ghc/tests/codeGen/should_run/cg025.hs b/ghc/tests/codeGen/should_run/cg025.hs index 6b2a8207e0a4e4142292287c142ca371f32cc2df..9700086ec2a849a2ee5ef3f9c0ba5bdc8dd0a2c5 100644 --- a/ghc/tests/codeGen/should_run/cg025.hs +++ b/ghc/tests/codeGen/should_run/cg025.hs @@ -3,8 +3,7 @@ -- import IO import System -import IOBase (trace) ---import Trace ToDo: get this via GlaExts -- SOF +import IOExts (trace) main = do prog <- getProgName diff --git a/ghc/tests/codeGen/should_run/cg025.stderr b/ghc/tests/codeGen/should_run/cg025.stderr index 8caaaca00a7c203eceeed48564b29d011e986474..6be7131e16ddeac4a8665adda60a9abd4259a180 100644 --- a/ghc/tests/codeGen/should_run/cg025.stderr +++ b/ghc/tests/codeGen/should_run/cg025.stderr @@ -6,8 +6,7 @@ -- import IO import System -import IOBase (trace) ---import Trace ToDo: get this via GlaExts -- SOF +import IOExts (trace) main = do prog <- getProgName diff --git a/ghc/tests/codeGen/should_run/cg026.hs b/ghc/tests/codeGen/should_run/cg026.hs index 8b11d6325f9383fe1354176501e87aa6fde7b17f..d6b4eafedeef20af5847b0ac7a96acdba029504b 100644 --- a/ghc/tests/codeGen/should_run/cg026.hs +++ b/ghc/tests/codeGen/should_run/cg026.hs @@ -2,12 +2,15 @@ -- module Main ( main ) where -import PrelBase --ghc1.3 -import GlaExts +import PrelBase import ST +import IOExts +import MutableArray +import ByteArray +import Addr -import Ratio -- 1.3 -import Array -- 1.3 +import Ratio +import Array main = putStr (test_chars ++ "\n" ++ @@ -25,9 +28,9 @@ test_chars :: String test_chars = let str = reverse "Now is the time for all good men to come to...\n" in - unsafePerformPrimIO ( + unsafePerformIO ( _ccall_ fprintf (``stdout''::Addr) "%d %s\n" 93 str >> - returnPrimIO "" + return "" ) -- Arr# Int# ------------------------------------------- @@ -56,7 +59,7 @@ test_ints fill_in arr_in# first# last# = if (first# ># last#) - then returnST () + then return () else writeIntArray arr_in# (I# first#) (I# (first# *# first#)) >> fill_in arr_in# (first# +# 1#) last# @@ -93,7 +96,7 @@ test_addrs fill_in arr_in# first# last# = if (first# ># last#) - then returnST () + then return () else writeAddrArray arr_in# (I# first#) (A# (int2Addr# (first# *# first#))) >> fill_in arr_in# (first# +# 1#) last# @@ -134,7 +137,7 @@ test_floats fill_in arr_in# first# last# = if (first# ># last#) - then returnST () + then return () {- else let e = ((fromInt (I# first#)) * pi) in trace (show e) $ writeFloatArray arr_in# (I# first#) e >> fill_in arr_in# (first# +# 1#) last# @@ -175,7 +178,7 @@ test_doubles fill_in arr_in# first# last# = if (first# ># last#) - then returnST () + then return () else writeDoubleArray arr_in# (I# first#) ((fromInt (I# first#)) * pi) >> fill_in arr_in# (first# +# 1#) last# @@ -209,7 +212,7 @@ test_ptrs fill_in arr_in# first last = if (first > last) - then returnST () + then return () else writeArray arr_in# first (fromInt (first * first)) >> fill_in arr_in# (first + 1) last diff --git a/ghc/tests/codeGen/should_run/cg029.hs b/ghc/tests/codeGen/should_run/cg029.hs index 7c14131e43ff1a7a36e20ac22e759d5d9c5e9725..9748af459b87a68632b867a5aaa23bbb1a627f29 100644 --- a/ghc/tests/codeGen/should_run/cg029.hs +++ b/ghc/tests/codeGen/should_run/cg029.hs @@ -3,7 +3,6 @@ module Main(main) where -- In 0.19, we lost the ability to do ccalls with more than 6 arguments -- on the Sparc. Just to make sure it never happens again... -import GlaExts main = _ccall_ printf "Testing %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n" @@ -11,5 +10,5 @@ main = (11::Int) (12::Int) (13::Int) (14::Int) (15::Int) (16::Int) (17::Int) (18::Int) (21::Int) (22::Int) (23::Int) (24::Int) (25::Int) (26::Int) (27::Int) (28::Int) (31::Int) (32::Int) (33::Int) (34::Int) (35::Int) (36::Int) (37::Int) (38::Int) - `thenIO_Prim` \ _ -> + >> return () diff --git a/ghc/tests/codeGen/should_run/cg035.hs b/ghc/tests/codeGen/should_run/cg035.hs index 6e6cbabb992d5ddff792d87c88c3189735897f72..9ac75fc5af894976d1c3581bcbd5033f9614c993 100644 --- a/ghc/tests/codeGen/should_run/cg035.hs +++ b/ghc/tests/codeGen/should_run/cg035.hs @@ -1,12 +1,11 @@ module Main (main) where ---import PreludeGlaST -import GlaExts +import IOExts ( unsafePerformIO ) po :: Double -> Double po rd = 0.5 + 0.5 * erf ((rd / 1.04) / sqrt 2) where erf :: Double -> Double - erf x = unsafePerformPrimIO (_ccall_ erf x) + erf x = unsafePerformIO (_ccall_ erf x) main = putStr (shows (po 2.0) "\n") diff --git a/ghc/tests/codeGen/should_run/cg042.hs b/ghc/tests/codeGen/should_run/cg042.hs index cbb44890c156380635fe0ce04e42f266931f180e..b20c4624b3cbc37286a39514e79bae1895bfe2c1 100644 --- a/ghc/tests/codeGen/should_run/cg042.hs +++ b/ghc/tests/codeGen/should_run/cg042.hs @@ -3,7 +3,9 @@ module Main ( main ) where import PrelBase --ghc1.3 -import GlaExts +import IOExts +import ByteArray +import MutableArray import ST import Ratio -- 1.3 @@ -37,7 +39,7 @@ test_doubles fill_in arr_in# first# last# = if (first# ># last#) - then returnST () + then return () else writeDoubleArray arr_in# (I# first#) ((fromInt (I# first#)) * pi) >> fill_in arr_in# (first# +# 1#) last# diff --git a/ghc/tests/codeGen/should_run/cg043.hs b/ghc/tests/codeGen/should_run/cg043.hs index 7e06095c5e3573eee9b65dfe87c2cca0a55b8630..1965c4458140a4ca13ad2dff5a5841206edb6821 100644 --- a/ghc/tests/codeGen/should_run/cg043.hs +++ b/ghc/tests/codeGen/should_run/cg043.hs @@ -3,10 +3,8 @@ --!!! when converting CoreSyn.App) module Main where -import GlaExts - -getData :: String -> PrimIO () +getData :: String -> IO () getData filename = case leng filename of {0 -> return ()} leng :: String -> Int leng [] = 0 --case ls of {[] -> 0 ; (_:xs) -> 1 + leng xs } @@ -16,6 +14,5 @@ f [] [] = [] f xs ys = f xs ys main = - primIOToIO ( - (return ()) >>= \ _ -> - case f [] [] of { [] -> getData [] }) + return () >>= \ _ -> + case f [] [] of { [] -> getData [] }