[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / disable-llvm.c
blob531c3159cd7431a02e284610e5ce6bd4f254e2d1
1 // We support a CC1 option for disabling LLVM's passes.
2 // RUN: %clang -O2 -Xclang -disable-llvm-passes -### %s 2>&1 \
3 // RUN: | FileCheck --check-prefix=DISABLED %s
5 // Try -Xclang=.
6 // RUN: %clang -O2 -Xclang=-disable-llvm-passes -### %s 2>&1 \
7 // RUN: | FileCheck --check-prefix=DISABLED %s
8 // DISABLED: -cc1
9 // DISABLED-NOT: "-mllvm" "-disable-llvm-passes"
10 // DISABLED: "-disable-llvm-passes"
12 // We also support two alternative spellings for historical reasons.
13 // RUN: %clang -O2 -Xclang -disable-llvm-optzns -### %s 2>&1 \
14 // RUN: | FileCheck --check-prefix=DISABLED-LEGACY %s
15 // RUN: %clang -O2 -mllvm -disable-llvm-optzns -### %s 2>&1 \
16 // RUN: | FileCheck --check-prefix=DISABLED-LEGACY %s
17 // DISABLED-LEGACY: -cc1
18 // DISABLED-LEGACY-NOT: "-mllvm" "-disable-llvm-optzns"
19 // DISABLED-LEGACY: "-disable-llvm-optzns"
21 // The main flag shouldn't be specially handled when used with '-mllvm'.
22 // RUN: %clang -O2 -mllvm -disable-llvm-passes -### %s 2>&1 | FileCheck --check-prefix=MLLVM %s
23 // MLLVM: -cc1
24 // MLLVM-NOT: -disable-llvm-passes
25 // MLLVM: "-mllvm" "-disable-llvm-passes"
26 // MLLVM-NOT: -disable-llvm-passes