summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2023-05-12 11:50:43 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-15 14:50:07 -0400
commit2f571afe1c2aeb3f4dfca2012bc6b713144fd234 (patch)
tree5e564313858d57f18b8e8469fe60a212697b9cd6 /testsuite
parent5ae81842d36a6091b406bfce98c60e8a7fa24240 (diff)
downloadhaskell-2f571afe1c2aeb3f4dfca2012bc6b713144fd234.tar.gz
Fix GHCJS OS platform (fix #23346)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/javascript/T23346.hs18
-rw-r--r--testsuite/tests/javascript/T23346.stdout1
-rw-r--r--testsuite/tests/javascript/all.T2
3 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/javascript/T23346.hs b/testsuite/tests/javascript/T23346.hs
new file mode 100644
index 0000000000..60fb2b8847
--- /dev/null
+++ b/testsuite/tests/javascript/T23346.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE CPP #-}
+
+module Main where
+
+main :: IO ()
+main = print (correct_host && correct_arch)
+
+#ifdef ghcjs_HOST_OS
+correct_host = True
+#else
+correct_host = False
+#endif
+
+#ifdef javascript_HOST_ARCH
+correct_arch = True
+#else
+correct_arch = False
+#endif
diff --git a/testsuite/tests/javascript/T23346.stdout b/testsuite/tests/javascript/T23346.stdout
new file mode 100644
index 0000000000..0ca95142bb
--- /dev/null
+++ b/testsuite/tests/javascript/T23346.stdout
@@ -0,0 +1 @@
+True
diff --git a/testsuite/tests/javascript/all.T b/testsuite/tests/javascript/all.T
index 3da7759da5..ff6b57a076 100644
--- a/testsuite/tests/javascript/all.T
+++ b/testsuite/tests/javascript/all.T
@@ -15,3 +15,5 @@ test('js-callback02', normal, compile_and_run, [''])
test('js-callback03', normal, compile_and_run, [''])
test('js-callback04', js_skip, compile_and_run, [''])
test('js-callback05', js_skip, compile_and_run, [''])
+
+test('T23346', normal, compile_and_run, [''])