blob: a7c5966c98d1d08f00877b1afa3f220970b38d3e [file] [log] [blame]
Reid Kleckner0290c9c2014-09-15 17:45:39 +00001// 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 Hinesa978a072016-04-20 00:33:06 +00005// RUN: echo "-DTEST" > %t.0.txt
Reid Kleckner0290c9c2014-09-15 17:45:39 +00006// 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 Smith29a0f0d2017-04-13 00:46:50 +000012// 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 Kleckner0290c9c2014-09-15 17:45:39 +000016// 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 Kleckner0290c9c2014-09-15 17:45:39 +000018// LONG: extern int it_works;
19
20#ifdef TEST
21extern int it_works;
22#endif