summaryrefslogtreecommitdiff
path: root/testsuite/tests/hsc2hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/hsc2hs')
-rw-r--r--testsuite/tests/hsc2hs/3837.hsc7
-rw-r--r--testsuite/tests/hsc2hs/Makefile16
-rw-r--r--testsuite/tests/hsc2hs/all.T20
-rw-r--r--testsuite/tests/hsc2hs/hsc2hs001.hsc6
-rw-r--r--testsuite/tests/hsc2hs/hsc2hs002.hsc6
5 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/tests/hsc2hs/3837.hsc b/testsuite/tests/hsc2hs/3837.hsc
new file mode 100644
index 0000000000..7f8ee255af
--- /dev/null
+++ b/testsuite/tests/hsc2hs/3837.hsc
@@ -0,0 +1,7 @@
+-- Test that UTF-8 is passed through correctly by hsc2hs
+
+#define uni Ⴀ
+
+#let name = "αβγ"
+
+main = let (#name) = 3 in print (#name)
diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile
new file mode 100644
index 0000000000..0b904f317c
--- /dev/null
+++ b/testsuite/tests/hsc2hs/Makefile
@@ -0,0 +1,16 @@
+TOP=../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+ALL_TESTS = hsc2hs001 hsc2hs002
+
+.PHONY: $(TESTS)
+
+$(ALL_TESTS):
+ '$(HSC2HS)' $@.hsc
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs
+
+.PHONY: 3837
+3837:
+ LANG=C '$(HSC2HS)' $@.hsc
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs
diff --git a/testsuite/tests/hsc2hs/all.T b/testsuite/tests/hsc2hs/all.T
new file mode 100644
index 0000000000..32900434d2
--- /dev/null
+++ b/testsuite/tests/hsc2hs/all.T
@@ -0,0 +1,20 @@
+
+test('hsc2hs001',
+ [extra_clean(['hsc2hs001.hs', 'hsc2hs001_hsc_make.c']),
+ if_platform('i386-unknown-mingw32', expect_broken(3929))],
+ run_command,
+ ['$MAKE -s --no-print-directory hsc2hs001'])
+
+test('hsc2hs002',
+ [extra_clean(['hsc2hs002.hs', 'hsc2hs002_hsc_make.c']),
+ if_platform('i386-unknown-mingw32', expect_broken(3929))],
+ run_command,
+ ['$MAKE -s --no-print-directory hsc2hs002'])
+
+
+test('3837',
+ [extra_clean(['3837.hs', '3837_hsc_make.c']),
+ if_platform('i386-unknown-mingw32', expect_broken(3929))],
+ run_command,
+ ['$MAKE -s --no-print-directory 3837'])
+
diff --git a/testsuite/tests/hsc2hs/hsc2hs001.hsc b/testsuite/tests/hsc2hs/hsc2hs001.hsc
new file mode 100644
index 0000000000..4a47501859
--- /dev/null
+++ b/testsuite/tests/hsc2hs/hsc2hs001.hsc
@@ -0,0 +1,6 @@
+
+module Main (main) where
+
+main :: IO ()
+main = print #size int
+
diff --git a/testsuite/tests/hsc2hs/hsc2hs002.hsc b/testsuite/tests/hsc2hs/hsc2hs002.hsc
new file mode 100644
index 0000000000..14cee92358
--- /dev/null
+++ b/testsuite/tests/hsc2hs/hsc2hs002.hsc
@@ -0,0 +1,6 @@
+
+module Main (main) where
+
+main :: IO ()
+main = print #size struct {int ab,cd;}
+