aboutsummaryrefslogtreecommitdiff
path: root/test/Driver/response-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Driver/response-file.c')
-rw-r--r--test/Driver/response-file.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Driver/response-file.c b/test/Driver/response-file.c
new file mode 100644
index 000000000000..208a941e8723
--- /dev/null
+++ b/test/Driver/response-file.c
@@ -0,0 +1,23 @@
+// REQUIRES: long_tests
+
+// Check that clang is able to process short response files
+// Since this is a short response file, clang must not use a response file
+// to pass its parameters to other tools. This is only necessary for a large
+// number of parameters.
+// RUN: echo "-DTEST" >> %t.0.txt
+// RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT
+// SHORT-NOT: Arguments passed via response file
+// SHORT: extern int it_works;
+
+// Check that clang is able to process long response files, routing a long
+// sequence of arguments to other tools by using response files as well.
+// We generate a 2MB response file to be big enough to surpass any system
+// limit.
+// RUN: %clang -E %S/Inputs/gen-response.c | grep DTEST > %t.1.txt
+// RUN: %clang -E @%t.1.txt %s -v 2>&1 | FileCheck %s -check-prefix=LONG
+// LONG: Arguments passed via response file
+// LONG: extern int it_works;
+
+#ifdef TEST
+extern int it_works;
+#endif