summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver
diff options
context:
space:
mode:
authorroland <rsx@bluewin.ch>2018-07-30 21:34:20 +0100
committerTamar Christina <tamar@zhox.com>2018-07-30 21:37:52 +0100
commita7c8acda5c7ad99fa983bbd5e59480ab5e633c54 (patch)
tree3514e0f7eb2e96f2402548632b4a76a4c00a5ce1 /testsuite/tests/driver
parent9d388eb83e797fd28e14868009c4786f3f1a8aa6 (diff)
downloadhaskell-a7c8acda5c7ad99fa983bbd5e59480ab5e633c54.tar.gz
GHC doesn't handle ./ prefixed paths correctly (#12674)
Summary: If a filename starts with a hypen, GHC keeps the prefixed "./" path. Test Plan: make test TEST=T12674 Reviewers: Phyx, nomeata, bgamari, erikd Reviewed By: Phyx Subscribers: rwbarton, thomie, carter GHC Trac Issues: #12674 Differential Revision: https://phabricator.haskell.org/D5009
Diffstat (limited to 'testsuite/tests/driver')
-rw-r--r--testsuite/tests/driver/T12674/-T12674.hs10
-rw-r--r--testsuite/tests/driver/T12674/-T12674c.c6
-rw-r--r--testsuite/tests/driver/T12674/T12674.stdout1
-rw-r--r--testsuite/tests/driver/T12674/T12674w.stdout1
-rw-r--r--testsuite/tests/driver/T12674/all.T5
5 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T12674/-T12674.hs b/testsuite/tests/driver/T12674/-T12674.hs
new file mode 100644
index 0000000000..11a7c546bd
--- /dev/null
+++ b/testsuite/tests/driver/T12674/-T12674.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
+import Foreign.C
+foreign import ccall unsafe "test" test :: CInt -> IO ()
+
+main :: IO ()
+-- Use conditional language to test passing a file with a filename
+-- starting with a hyphen to the preprocessor.
+#if defined(__GLASGOW_HASKELL__)
+main = test 3
+#endif
diff --git a/testsuite/tests/driver/T12674/-T12674c.c b/testsuite/tests/driver/T12674/-T12674c.c
new file mode 100644
index 0000000000..3b38c5879e
--- /dev/null
+++ b/testsuite/tests/driver/T12674/-T12674c.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+void test(int arg
+)
+{
+ printf("Result %i\n", arg );
+}
diff --git a/testsuite/tests/driver/T12674/T12674.stdout b/testsuite/tests/driver/T12674/T12674.stdout
new file mode 100644
index 0000000000..76239dd5cb
--- /dev/null
+++ b/testsuite/tests/driver/T12674/T12674.stdout
@@ -0,0 +1 @@
+Result 3
diff --git a/testsuite/tests/driver/T12674/T12674w.stdout b/testsuite/tests/driver/T12674/T12674w.stdout
new file mode 100644
index 0000000000..76239dd5cb
--- /dev/null
+++ b/testsuite/tests/driver/T12674/T12674w.stdout
@@ -0,0 +1 @@
+Result 3
diff --git a/testsuite/tests/driver/T12674/all.T b/testsuite/tests/driver/T12674/all.T
new file mode 100644
index 0000000000..0f9e205c9f
--- /dev/null
+++ b/testsuite/tests/driver/T12674/all.T
@@ -0,0 +1,5 @@
+test('T12674', [extra_files(['-T12674.hs', '-T12674c.c'])],
+ multi_compile, ['./-T12674.hs', [('././-T12674c.c', '')], '-v0'])
+test('T12674w', [extra_files(['-T12674.hs', '-T12674c.c']),
+ unless(opsys('mingw32'), skip)],
+ multi_compile, ['.\\\-T12674.hs', [('.\\\.\\\-T12674c.c', '')], '-v0'])