Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 1 | // Check that clang is able to process short response files |
| 2 | // Since this is a short response file, clang must not use a response file |
| 3 | // to pass its parameters to other tools. This is only necessary for a large |
| 4 | // number of parameters. |
Stephen Hines | a978a07 | 2016-04-20 00:33:06 +0000 | [diff] [blame] | 5 | // RUN: echo "-DTEST" > %t.0.txt |
Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 6 | // RUN: %clang -E @%t.0.txt %s -v 2>&1 | FileCheck %s -check-prefix=SHORT |
| 7 | // SHORT-NOT: Arguments passed via response file |
| 8 | // SHORT: extern int it_works; |
| 9 | |
| 10 | // Check that clang is able to process long response files, routing a long |
| 11 | // sequence of arguments to other tools by using response files as well. |
Richard Smith | 29a0f0d | 2017-04-13 00:46:50 +0000 | [diff] [blame] | 12 | // We generate a 2MB response file to attempt to surpass any system limit. |
| 13 | // But there's no guarantee that we actually will (the system limit could be |
| 14 | // *huge*), so just check that invoking cc1 succeeds under these conditions. |
| 15 | // |
Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 16 | // RUN: %clang -E %S/Inputs/gen-response.c | grep DTEST > %t.1.txt |
| 17 | // RUN: %clang -E @%t.1.txt %s -v 2>&1 | FileCheck %s -check-prefix=LONG |
Reid Kleckner | 0290c9c | 2014-09-15 17:45:39 +0000 | [diff] [blame] | 18 | // LONG: extern int it_works; |
| 19 | |
| 20 | #ifdef TEST |
| 21 | extern int it_works; |
| 22 | #endif |