summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-08-04 10:26:15 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-09 08:10:11 -0400
commitcf7e6c8d3492fdfbbbf0bf853feed4743e04e75e (patch)
tree3586fe18721fa9160ed0c3365976c69f8569f3e2
parent2bf417f61b159cf681b6d35d0766662b77492cc1 (diff)
downloadhaskell-cf7e6c8d3492fdfbbbf0bf853feed4743e04e75e.tar.gz
testsuite: Add test for #20199
Ensures that Rts.h can be parsed as C++.
-rw-r--r--testsuite/tests/rts/Makefile5
-rw-r--r--testsuite/tests/rts/T20199.cpp10
-rw-r--r--testsuite/tests/rts/T20199.stderr1
-rw-r--r--testsuite/tests/rts/all.T1
4 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 51f2746c1f..9350caf9ec 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -130,3 +130,8 @@ EventlogOutput2:
"$(TEST_HC)" -eventlog -v0 EventlogOutput.hs
./EventlogOutput +RTS -l
ls EventlogOutput.eventlog >/dev/null
+
+.PHONY: T20199
+T20199:
+ "$(TEST_HC)" -no-hs-main -v0 T20199.cpp -o T20199
+ ./T20199
diff --git a/testsuite/tests/rts/T20199.cpp b/testsuite/tests/rts/T20199.cpp
new file mode 100644
index 0000000000..00a3345dbd
--- /dev/null
+++ b/testsuite/tests/rts/T20199.cpp
@@ -0,0 +1,10 @@
+/* verify that Rts.h can be parsed as a C++ header */
+extern "C" {
+#include "Rts.h"
+}
+
+extern "C"
+int main(int argc, char *argv[]) {
+ debugBelch("Hello world!");
+ return 0;
+}
diff --git a/testsuite/tests/rts/T20199.stderr b/testsuite/tests/rts/T20199.stderr
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/testsuite/tests/rts/T20199.stderr
@@ -0,0 +1 @@
+Hello world! \ No newline at end of file
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index cd4a92dd7b..aeab6b4b2e 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -439,3 +439,4 @@ test('T15427', normal, compile_and_run, [''])
test('T19481', extra_run_opts('+RTS -T -RTS'), compile_and_run, [''])
test('T19381', extra_run_opts('+RTS -T -RTS'), compile_and_run, [''])
+test('T20199', normal, makefile_test, [])