summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/.gitignore3
-rw-r--r--testsuite/tests/driver/Makefile11
-rw-r--r--testsuite/tests/driver/T12135.hs3
-rw-r--r--testsuite/tests/driver/T12135.stdout4
-rw-r--r--testsuite/tests/driver/T12135a.h1
-rw-r--r--testsuite/tests/driver/T12135b.h1
-rw-r--r--testsuite/tests/driver/all.T6
7 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore
index e1f1822159..87e3558677 100644
--- a/testsuite/.gitignore
+++ b/testsuite/.gitignore
@@ -572,6 +572,9 @@ mk/ghcconfig*_test___spaces_ghc*.exe.mk
/tests/driver/T8602/t8602.sh
/tests/driver/T9562/Main
/tests/driver/T11763
+/tests/driver/T12135
+/tests/driver/T12135a
+/tests/driver/T12135b
/tests/driver/Test.081b
/tests/driver/Test.081b.hs
/tests/driver/Test_081a
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile
index 51fb71a39b..41a1891377 100644
--- a/testsuite/tests/driver/Makefile
+++ b/testsuite/tests/driver/Makefile
@@ -621,3 +621,14 @@ T10320:
[ -s T10320.dump-rule-rewrites ]
"$(TEST_HC)" $(TEST_HC_OPTS) -ddump-to-file -ddump-rule-rewrites T10320.hs
[ -f T10320.dump-rule-rewrites ] && [ ! -s T10320.dump-rule-rewrites ]
+
+.PHONY: T12135
+T12135:
+ $(RM) -rf T12135.o T12135.hi T12135 T12135a T12135b
+ mkdir T12135a T12135b
+ cp T12135a.h T12135a/T12135.h
+ "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -IT12135b -IT12135a --make T12135.hs
+ ./T12135
+ cp T12135b.h T12135b/T12135.h
+ "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -IT12135b -IT12135a --make T12135.hs
+ ./T12135
diff --git a/testsuite/tests/driver/T12135.hs b/testsuite/tests/driver/T12135.hs
new file mode 100644
index 0000000000..f6ea19d061
--- /dev/null
+++ b/testsuite/tests/driver/T12135.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE CPP #-}
+#include "T12135.h"
+main = print message
diff --git a/testsuite/tests/driver/T12135.stdout b/testsuite/tests/driver/T12135.stdout
new file mode 100644
index 0000000000..8da4f156fa
--- /dev/null
+++ b/testsuite/tests/driver/T12135.stdout
@@ -0,0 +1,4 @@
+[1 of 1] Compiling Main ( T12135.hs, T12135.o )
+Linking T12135 ...
+1
+2
diff --git a/testsuite/tests/driver/T12135a.h b/testsuite/tests/driver/T12135a.h
new file mode 100644
index 0000000000..36030790f6
--- /dev/null
+++ b/testsuite/tests/driver/T12135a.h
@@ -0,0 +1 @@
+message = 1
diff --git a/testsuite/tests/driver/T12135b.h b/testsuite/tests/driver/T12135b.h
new file mode 100644
index 0000000000..cefcf6b675
--- /dev/null
+++ b/testsuite/tests/driver/T12135b.h
@@ -0,0 +1 @@
+message = 2
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 1adf482956..54c84bca36 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -482,3 +482,9 @@ test('T10320',
, extra_clean(['T10320', 'T10320.o', 'T10320.hi'])],
run_command,
['$MAKE -s --no-print-directory T10320'])
+
+test('T12135',
+ [expect_broken(12135),
+ extra_clean(['T12135.o', 'T12135.hi', 'T12135', 'T12135a/T12135.h', 'T12135b/T12135.h'])],
+ run_command,
+ ['$MAKE -s --no-print-directory T12135'])