summaryrefslogtreecommitdiff
path: root/test cases/common/13 pch/withIncludeFile/prog.c
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2021-05-07 20:29:33 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-05-08 21:27:35 +0300
commitd5932a174d1504f1efea681e5ec3fd364de1ff6f (patch)
treeed982ed005927be7bdab1ce3c931763cdf53b281 /test cases/common/13 pch/withIncludeFile/prog.c
parent739e499554850d2cb8268bed219e8ba127051f76 (diff)
downloadmeson-d5932a174d1504f1efea681e5ec3fd364de1ff6f.tar.gz
test cases: Add test ensuring that -include in gcc won't break pch
This is just forcing the usage of -include as c_args, even though this particular case can happen easily when this is provided via a dependency cflags. We also ensure that both the headers are included by using locale definitions.
Diffstat (limited to 'test cases/common/13 pch/withIncludeFile/prog.c')
-rw-r--r--test cases/common/13 pch/withIncludeFile/prog.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test cases/common/13 pch/withIncludeFile/prog.c b/test cases/common/13 pch/withIncludeFile/prog.c
new file mode 100644
index 000000000..7a9a93c6a
--- /dev/null
+++ b/test cases/common/13 pch/withIncludeFile/prog.c
@@ -0,0 +1,11 @@
+// No includes here, they need to come from the PCH or explicit inclusion
+
+void func(void) {
+ fprintf(stdout, "This is a function that fails if stdio is not #included.\n");
+ setlocale(LC_ALL, ""); /* This will fail if locale.h is not included */
+}
+
+int main(void) {
+ return 0;
+}
+