Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / fbasic-block-sections.c
blob417cf9b6319bde97ff34ba73ac5968d472e99b97
1 // RUN: %clang -### -target x86_64 -fbasic-block-sections=none %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NONE %s
2 // RUN: %clang -### -target x86_64 -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-ALL %s
3 // RUN: %clang -### -target x86_64 -fbasic-block-sections=list=%s %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-LIST %s
4 // RUN: %clang -### -target x86_64 -fbasic-block-sections=labels %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-LABELS %s
5 // RUN: not %clang -c -target arm-unknown-linux -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
6 // RUN: %clang -### -target arm-unknown-linux -fbasic-block-sections=all -fbasic-block-sections=none %s -S 2>&1 \
7 // RUN: | FileCheck -check-prefix=CHECK-NOOPT %s
8 // RUN: not %clang -c -target x86_64-apple-darwin10 -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
9 // RUN: not %clang -### -target x86_64 -fbasic-block-sections=alll %s -S 2>&1 | FileCheck -check-prefix=CHECK-INVALID-VALUE %s
10 // RUN: not %clang -### -target x86_64 -fbasic-block-sections=list %s -S 2>&1 | FileCheck -check-prefix=CHECK-INVALID-VALUE %s
11 // RUN: %clang -### -target x86_64 -fbasic-block-sections=list= %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NULL-LIST %s
12 // RUN: %clang -### -target x86_64 -fbasic-block-sections=none %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NONE %s
13 // RUN: %clang -### -x cuda -nocudainc -nocudalib --target=x86_64 -fbasic-block-sections=all --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s -c 2>&1 \
14 // RUN: | FileCheck -check-prefix=CHECK-CUDA %s
17 // CHECK-NOOPT-NOT: -fbasic-block-sections=
18 // CHECK-OPT-NONE: "-fbasic-block-sections=none"
19 // CHECK-OPT-ALL: "-fbasic-block-sections=all"
20 // CHECK-OPT-LIST: "-fbasic-block-sections={{[^ ]*}}fbasic-block-sections.c"
21 // CHECK-OPT-LABELS: "-fbasic-block-sections=labels"
22 // CHECK-TRIPLE: error: unsupported option '-fbasic-block-sections=all' for target
23 // CHECK-INVALID-VALUE: error: invalid value {{[^ ]*}} in '-fbasic-block-sections={{.*}}'
24 // CHECK-OPT-NULL-LIST: "-fbasic-block-sections=list="
26 // GPU-side compilations should have no -fbasic-block-sections. It should only
27 // be passed to the host compilation
28 // CHECK-CUDA-NOT: -fbasic-block-sections=
29 // CHECK-CUDA: "-cc1" "-triple" "x86_64"
30 // CHECK-CUDA-SAME: "-fbasic-block-sections=all"