1 // RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=YES
2 // RUN: %clang -fno-integrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=NO
3 
4 // RUN: %clang -fintegrated-cc1 -fno-integrated-cc1 -c -### %s 2>&1 \
5 // RUN:     | FileCheck %s --check-prefix=NO
6 // RUN: %clang -fno-integrated-cc1 -fintegrated-cc1 -c -### %s 2>&1 \
7 // RUN:     | FileCheck %s --check-prefix=YES
8 
9 // RUN: %clang_cl -fintegrated-cc1 -c -### -- %s 2>&1 \
10 // RUN:     | FileCheck %s --check-prefix=YES
11 // RUN: %clang_cl -fno-integrated-cc1 -c -### -- %s 2>&1 \
12 // RUN:     | FileCheck %s --check-prefix=NO
13 
14 // RUN: env CCC_OVERRIDE_OPTIONS=+-fintegrated-cc1 \
15 // RUN:     %clang -fintegrated-cc1 -c -### %s 2>&1 \
16 // RUN:     | FileCheck %s --check-prefix=YES
17 // RUN: env CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 \
18 // RUN:     %clang -fintegrated-cc1 -c -### %s 2>&1 \
19 // RUN:     | FileCheck %s --check-prefix=NO
20 
21 // YES: (in-process)
22 // NO-NOT: (in-process)
23 
24 // The following tests ensure that only one integrated-cc1 is executed.
25 
26 // Only one TU, one job, thus integrated-cc1 is enabled.
27 // RUN: %clang -fintegrated-cc1 -c %s -### 2>&1 | FileCheck %s --check-prefix=YES
28 
29 // Only one TU, but we're linking, two jobs, thus integrated-cc1 is disabled.
30 // RUN: %clang -fintegrated-cc1 %s -### 2>&1 | FileCheck %s --check-prefix=NO
31 
32 // RUN: echo 'int main() { return f() + g(); }' > %t1.cpp
33 // RUN: echo 'int f() { return 1; }' > %t2.cpp
34 // RUN: echo 'int g() { return 2; }' > %t3.cpp
35 
36 // Three jobs, thus integrated-cc1 is disabled.
37 // RUN: %clang -fintegrated-cc1 -c %t1.cpp %t2.cpp %t3.cpp -### 2>&1 | FileCheck %s --check-prefix=NO
38