summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun025.hs
blob: 39255c147d9dd2c578e0e1fdf1e3f8d0124239ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE ScopedTypeVariables #-}
-- !!! test various I/O Requests
--
--
import Control.Exception
import System.Environment
import System.IO
import Debug.Trace (trace)
import Data.Maybe
import Data.List (isInfixOf)

main = do
    prog <- getProgName
    let True = "cgrun025" `isInfixOf` prog
    hPutStr stderr (shows prog "\n")
    args <- getArgs
    hPutStr stderr (shows args "\n")
    path <- getEnv "PATH"
    hPutStr stderr ("GOT PATH\n")
    stdin_txt <- getContents
    putStr stdin_txt
    file_cts <- readFile (head args)
    hPutStr  stderr file_cts
    trace "hello, trace" $
      catch (getEnv "__WURBLE__" >> return ()) (\ (e :: SomeException) -> error "hello, error")