Reorganisation of the source tree
[ghc-hetmet.git] / compiler / ilxGen / tests / test21.hs
diff --git a/compiler/ilxGen/tests/test21.hs b/compiler/ilxGen/tests/test21.hs
new file mode 100644 (file)
index 0000000..1870f22
--- /dev/null
@@ -0,0 +1,13 @@
+{-# OPTIONS -fno-implicit-prelude  #-}
+
+import PrelIOBase
+import PrelIO
+import PrelBase
+import PrelAddr
+
+foreign import "libHS_cbits" "getErrStr__"  unsafe ggetErrStr__  :: Int -> IO Addr 
+
+main = putStr (uunsafePerformIO (ggetErrStr__ 4))
+
+uunsafePerformIO       :: IO Addr -> [Char]
+uunsafePerformIO (IO m) = case m realWorld# of (# _, (A# r) #)   -> (unpackCString#  r)