49 lines · c
1// If a toolchain uses an external assembler, the test would fail because using2// an external assember would increase job counts. Most toolchains in tree3// use integrated assembler, but we still support external assembler.4// So -fintegrated-as is specified explicitly when applicable.5 6// RUN: %clang -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 | FileCheck %s --check-prefix=YES7// RUN: %clang -fno-integrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=NO8 9// RUN: %clang -fintegrated-cc1 -fno-integrated-cc1 -c -### %s 2>&1 \10// RUN: | FileCheck %s --check-prefix=NO11// RUN: %clang -fno-integrated-cc1 -fintegrated-cc1 -fintegrated-as -c -### %s 2>&1 \12// RUN: | FileCheck %s --check-prefix=YES13 14// RUN: %clang_cl -fintegrated-cc1 -fintegrated-as -c -### -- %s 2>&1 \15// RUN: | FileCheck %s --check-prefix=YES16// RUN: %clang_cl -fno-integrated-cc1 -c -### -- %s 2>&1 \17// RUN: | FileCheck %s --check-prefix=NO18 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=YES22// RUN: env CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 \23// RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 \24// RUN: | FileCheck %s --check-prefix=NO25 26// YES: (in-process)27// NO-NOT: (in-process)28 29// The following tests ensure that only one integrated-cc1 is executed.30 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=YES33 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=NO36 37// RUN: echo 'int main() { return f() + g(); }' > %t1.cpp38// RUN: echo 'int f() { return 1; }' > %t2.cpp39// RUN: echo 'int g() { return 2; }' > %t3.cpp40 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=NO43 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.s47// RUN: %clang --target=x86_64-linux -fintegrated-cc1 -fintegrated-as -c -### %t.s 2>&1 | FileCheck %s --check-prefix=YES48// RUN: %clang --target=x86_64-linux -fno-integrated-cc1 -c -### %t.s 2>&1 | FileCheck %s --check-prefix=NO49