13a2df3baSYuanfang Chen // If a toolchain uses an external assembler, the test would fail because using 23a2df3baSYuanfang Chen // an external assember would increase job counts. Most toolchains in tree 33a2df3baSYuanfang Chen // use integrated assembler, but we still support external assembler. 43a2df3baSYuanfang Chen // So -fintegrated-as is specified explicitly when applicable. 53a2df3baSYuanfang Chen 63a2df3baSYuanfang Chen // RUN: %clang -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 | FileCheck %s --check-prefix=YES 720f1abe3SAlexandre Ganea // RUN: %clang -fno-integrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=NO 88e5018e9SNico Weber 920f1abe3SAlexandre Ganea // RUN: %clang -fintegrated-cc1 -fno-integrated-cc1 -c -### %s 2>&1 \ 108e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=NO 113a2df3baSYuanfang Chen // RUN: %clang -fno-integrated-cc1 -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 \ 128e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=YES 138e5018e9SNico Weber 143a2df3baSYuanfang Chen // RUN: %clang_cl -fintegrated-cc1 -fintegrated-as -c -### -- %s 2>&1 \ 158e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=YES 1620f1abe3SAlexandre Ganea // RUN: %clang_cl -fno-integrated-cc1 -c -### -- %s 2>&1 \ 178e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=NO 188e5018e9SNico Weber 198e5018e9SNico Weber // RUN: env CCC_OVERRIDE_OPTIONS=+-fintegrated-cc1 \ 203a2df3baSYuanfang Chen // RUN: %clang -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 \ 218e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=YES 228e5018e9SNico Weber // RUN: env CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 \ 2320f1abe3SAlexandre Ganea // RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 \ 248e5018e9SNico Weber // RUN: | FileCheck %s --check-prefix=NO 258e5018e9SNico Weber 268e5018e9SNico Weber // YES: (in-process) 278e5018e9SNico Weber // NO-NOT: (in-process) 2820f1abe3SAlexandre Ganea 2920f1abe3SAlexandre Ganea // The following tests ensure that only one integrated-cc1 is executed. 3020f1abe3SAlexandre Ganea 3120f1abe3SAlexandre Ganea // Only one TU, one job, thus integrated-cc1 is enabled. 323a2df3baSYuanfang Chen // RUN: %clang -fintegrated-cc1 -fintegrated-as -c %s -### 2>&1 | FileCheck %s --check-prefix=YES 3320f1abe3SAlexandre Ganea 3420f1abe3SAlexandre Ganea // Only one TU, but we're linking, two jobs, thus integrated-cc1 is disabled. 3520f1abe3SAlexandre Ganea // RUN: %clang -fintegrated-cc1 %s -### 2>&1 | FileCheck %s --check-prefix=NO 3620f1abe3SAlexandre Ganea 3720f1abe3SAlexandre Ganea // RUN: echo 'int main() { return f() + g(); }' > %t1.cpp 3820f1abe3SAlexandre Ganea // RUN: echo 'int f() { return 1; }' > %t2.cpp 3920f1abe3SAlexandre Ganea // RUN: echo 'int g() { return 2; }' > %t3.cpp 4020f1abe3SAlexandre Ganea 4120f1abe3SAlexandre Ganea // Three jobs, thus integrated-cc1 is disabled. 4220f1abe3SAlexandre Ganea // RUN: %clang -fintegrated-cc1 -c %t1.cpp %t2.cpp %t3.cpp -### 2>&1 | FileCheck %s --check-prefix=NO 43bc7df035SFangrui Song 44bc7df035SFangrui Song // -fintegrated-cc1 works with cc1as. 45*c35448baSFangrui Song // macOS triples have an extra -x assembler-with-cpp job so (in-process) is not triggered. 46bc7df035SFangrui Song // RUN: echo > %t.s 47*c35448baSFangrui Song // RUN: %clang --target=x86_64-linux -fintegrated-cc1 -fintegrated-as -c -### %t.s 2>&1 | FileCheck %s --check-prefix=YES 48*c35448baSFangrui Song // RUN: %clang --target=x86_64-linux -fno-integrated-cc1 -c -### %t.s 2>&1 | FileCheck %s --check-prefix=NO 49