summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-e/should_run
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghc-e/should_run')
-rw-r--r--testsuite/tests/ghc-e/should_run/2228.hs4
-rw-r--r--testsuite/tests/ghc-e/should_run/2228.stdout2
-rw-r--r--testsuite/tests/ghc-e/should_run/2636.hs2
-rw-r--r--testsuite/tests/ghc-e/should_run/2636.stderr4
-rw-r--r--testsuite/tests/ghc-e/should_run/3890.hs9
-rw-r--r--testsuite/tests/ghc-e/should_run/3890.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/Makefile29
-rw-r--r--testsuite/tests/ghc-e/should_run/all.T12
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e002.hs3
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e002.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e003.stdout2
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e004.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.hs13
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.stderr1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.stdout3
15 files changed, 87 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-e/should_run/2228.hs b/testsuite/tests/ghc-e/should_run/2228.hs
new file mode 100644
index 0000000000..0c53c5ae13
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/2228.hs
@@ -0,0 +1,4 @@
+import System.IO
+main = do
+ hGetBuffering stdin >>= print
+ hGetBuffering stdout >>= print
diff --git a/testsuite/tests/ghc-e/should_run/2228.stdout b/testsuite/tests/ghc-e/should_run/2228.stdout
new file mode 100644
index 0000000000..07576b5a74
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/2228.stdout
@@ -0,0 +1,2 @@
+BlockBuffering Nothing
+BlockBuffering Nothing
diff --git a/testsuite/tests/ghc-e/should_run/2636.hs b/testsuite/tests/ghc-e/should_run/2636.hs
new file mode 100644
index 0000000000..9c6694955a
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/2636.hs
@@ -0,0 +1,2 @@
+import MissingModule
+main = print "main"
diff --git a/testsuite/tests/ghc-e/should_run/2636.stderr b/testsuite/tests/ghc-e/should_run/2636.stderr
new file mode 100644
index 0000000000..e69b54b36e
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/2636.stderr
@@ -0,0 +1,4 @@
+
+2636.hs:1:8:
+ Could not find module `MissingModule'
+ Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/ghc-e/should_run/3890.hs b/testsuite/tests/ghc-e/should_run/3890.hs
new file mode 100644
index 0000000000..a72e5c82a0
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/3890.hs
@@ -0,0 +1,9 @@
+module Main (main) where
+
+import System.Exit
+import System.IO
+
+main :: IO ()
+main = do putStrLn "Q1"
+ exitFailure
+ putStrLn "Q2"
diff --git a/testsuite/tests/ghc-e/should_run/3890.stdout b/testsuite/tests/ghc-e/should_run/3890.stdout
new file mode 100644
index 0000000000..7e6c303ad6
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/3890.stdout
@@ -0,0 +1 @@
+Q1
diff --git a/testsuite/tests/ghc-e/should_run/Makefile b/testsuite/tests/ghc-e/should_run/Makefile
new file mode 100644
index 0000000000..2a7fd0a7a8
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/Makefile
@@ -0,0 +1,29 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+ghc-e001:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "return ()"
+
+ghc-e002:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" ghc-e002.hs
+
+ghc-e003:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e 'putStrLn "Foo"' -e 'putStrLn "Bar"'
+
+ghc-e004:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":m + System.Exit" -e "exitWith (ExitFailure 6)"; echo $$?
+
+# This is what runghc does:
+ghc-e005:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -main-is foo ghc-e005.hs -e ":set prog ghc-e005-prog" -e ":main [\"the\",\"args\"]"; echo $$?
+
+2228:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 2228.hs
+
+2636:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 2636.hs; if [ "$?" != 0 ]; then true; else false; fi
+
+3890:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 3890.hs | cat
+
diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T
new file mode 100644
index 0000000000..6039a4088b
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/all.T
@@ -0,0 +1,12 @@
+
+setTestOpts(if_compiler_profiled(skip))
+
+test('ghc-e001', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
+test('ghc-e002', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
+test('ghc-e003', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e003'])
+test('ghc-e004', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e004'])
+test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
+
+test('2228', req_interp, run_command, ['$MAKE --no-print-directory -s 2228'])
+test('2636', req_interp, run_command, ['$MAKE --no-print-directory -s 2636'])
+test('3890', req_interp, run_command, ['$MAKE --no-print-directory -s 3890'])
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e002.hs b/testsuite/tests/ghc-e/should_run/ghc-e002.hs
new file mode 100644
index 0000000000..028b1a0166
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e002.hs
@@ -0,0 +1,3 @@
+
+main :: IO ()
+main = putStrLn "This is main"
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e002.stdout b/testsuite/tests/ghc-e/should_run/ghc-e002.stdout
new file mode 100644
index 0000000000..23e1ebd03b
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e002.stdout
@@ -0,0 +1 @@
+This is main
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e003.stdout b/testsuite/tests/ghc-e/should_run/ghc-e003.stdout
new file mode 100644
index 0000000000..3b71d5be87
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e003.stdout
@@ -0,0 +1,2 @@
+Foo
+Bar
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e004.stdout b/testsuite/tests/ghc-e/should_run/ghc-e004.stdout
new file mode 100644
index 0000000000..1e8b314962
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e004.stdout
@@ -0,0 +1 @@
+6
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.hs b/testsuite/tests/ghc-e/should_run/ghc-e005.hs
new file mode 100644
index 0000000000..4899706d77
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.hs
@@ -0,0 +1,13 @@
+
+import System.Environment
+import System.IO
+
+main :: IO ()
+main = error "main got called"
+
+foo :: IO ()
+foo = do putStrLn "This is foo"
+ getArgs >>= print
+ hFlush stdout
+ error "foo"
+
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.stderr b/testsuite/tests/ghc-e/should_run/ghc-e005.stderr
new file mode 100644
index 0000000000..34cecca662
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.stderr
@@ -0,0 +1 @@
+ghc-e005-prog: foo
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.stdout b/testsuite/tests/ghc-e/should_run/ghc-e005.stdout
new file mode 100644
index 0000000000..57cc51465d
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.stdout
@@ -0,0 +1,3 @@
+This is foo
+["the","args"]
+1