[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / Driver / cc1-spawnprocess.c
bloba6ff7d148604e313454aa97bbe2b3907eaf3e390
1 // If a toolchain uses an external assembler, the test would fail because using
2 // an external assember would increase job counts. Most toolchains in tree
3 // use integrated assembler, but we still support external assembler.
4 // So -fintegrated-as is specified explicitly when applicable.
6 // RUN: %clang -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 | FileCheck %s --check-prefix=YES
7 // RUN: %clang -fno-integrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=NO
9 // RUN: %clang -fintegrated-cc1 -fno-integrated-cc1 -c -### %s 2>&1 \
10 // RUN: | FileCheck %s --check-prefix=NO
11 // RUN: %clang -fno-integrated-cc1 -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 \
12 // RUN: | FileCheck %s --check-prefix=YES
14 // RUN: %clang_cl -fintegrated-cc1 -fintegrated-as -c -### -- %s 2>&1 \
15 // RUN: | FileCheck %s --check-prefix=YES
16 // RUN: %clang_cl -fno-integrated-cc1 -c -### -- %s 2>&1 \
17 // RUN: | FileCheck %s --check-prefix=NO
19 // RUN: env CCC_OVERRIDE_OPTIONS=+-fintegrated-cc1 \
20 // RUN: %clang -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 \
21 // RUN: | FileCheck %s --check-prefix=YES
22 // RUN: env CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 \
23 // RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 \
24 // RUN: | FileCheck %s --check-prefix=NO
26 // YES: (in-process)
27 // NO-NOT: (in-process)
29 // The following tests ensure that only one integrated-cc1 is executed.
31 // Only one TU, one job, thus integrated-cc1 is enabled.
32 // RUN: %clang -fintegrated-cc1 -fintegrated-as -c %s -### 2>&1 | FileCheck %s --check-prefix=YES
34 // Only one TU, but we're linking, two jobs, thus integrated-cc1 is disabled.
35 // RUN: %clang -fintegrated-cc1 %s -### 2>&1 | FileCheck %s --check-prefix=NO
37 // RUN: echo 'int main() { return f() + g(); }' > %t1.cpp
38 // RUN: echo 'int f() { return 1; }' > %t2.cpp
39 // RUN: echo 'int g() { return 2; }' > %t3.cpp
41 // Three jobs, thus integrated-cc1 is disabled.
42 // RUN: %clang -fintegrated-cc1 -c %t1.cpp %t2.cpp %t3.cpp -### 2>&1 | FileCheck %s --check-prefix=NO
44 // -fintegrated-cc1 works with cc1as.
45 // macOS triples have an extra -x assembler-with-cpp job so (in-process) is not triggered.
46 // RUN: echo > %t.s
47 // RUN: %clang --target=x86_64-linux -fintegrated-cc1 -fintegrated-as -c -### %t.s 2>&1 | FileCheck %s --check-prefix=YES
48 // RUN: %clang --target=x86_64-linux -fno-integrated-cc1 -c -### %t.s 2>&1 | FileCheck %s --check-prefix=NO