1157cd93bSSnehasish Kumar // RUN: %clang -### -target x86_64 -fbasic-block-sections=none %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NONE %s 2157cd93bSSnehasish Kumar // RUN: %clang -### -target x86_64 -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-ALL %s 3157cd93bSSnehasish Kumar // RUN: %clang -### -target x86_64 -fbasic-block-sections=list=%s %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-LIST %s 4157cd93bSSnehasish Kumar // RUN: %clang -### -target x86_64 -fbasic-block-sections=labels %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-LABELS %s 5157cd93bSSnehasish Kumar // RUN: not %clang -c -target arm-unknown-linux -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s 6cab5f89cSArtem Belevich // RUN: %clang -### -target arm-unknown-linux -fbasic-block-sections=all -fbasic-block-sections=none %s -S 2>&1 \ 7cab5f89cSArtem Belevich // RUN: | FileCheck -check-prefix=CHECK-NOOPT %s 8157cd93bSSnehasish Kumar // RUN: not %clang -c -target x86_64-apple-darwin10 -fbasic-block-sections=all %s -S 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s 9f8878546SSriraman Tallam // RUN: %clang -### -target x86_64 -fbasic-block-sections=alll %s -S 2>&1 | FileCheck -check-prefix=CHECK-INVALID-VALUE %s 10f8878546SSriraman Tallam // RUN: %clang -### -target x86_64 -fbasic-block-sections=list %s -S 2>&1 | FileCheck -check-prefix=CHECK-INVALID-VALUE %s 11f8878546SSriraman Tallam // RUN: %clang -### -target x86_64 -fbasic-block-sections=list= %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NULL-LIST %s 12cab5f89cSArtem Belevich // RUN: %clang -### -target x86_64 -fbasic-block-sections=none %s -S 2>&1 | FileCheck -check-prefix=CHECK-OPT-NONE %s 13cab5f89cSArtem Belevich // RUN: %clang -### -x cuda -nocudainc -nocudalib -target x86_64 -fbasic-block-sections=all %s -c 2>&1 \ 14cab5f89cSArtem Belevich // RUN: | FileCheck -check-prefix=CHECK-CUDA %s 15cab5f89cSArtem Belevich 16*5c29ffdaSFangrui Song // 17cab5f89cSArtem Belevich // CHECK-NOOPT-NOT: -fbasic-block-sections= 18e0bca46bSSriraman Tallam // CHECK-OPT-NONE: "-fbasic-block-sections=none" 19e0bca46bSSriraman Tallam // CHECK-OPT-ALL: "-fbasic-block-sections=all" 20e0bca46bSSriraman Tallam // CHECK-OPT-LIST: "-fbasic-block-sections={{[^ ]*}}fbasic-block-sections.c" 21e0bca46bSSriraman Tallam // CHECK-OPT-LABELS: "-fbasic-block-sections=labels" 22157cd93bSSnehasish Kumar // CHECK-TRIPLE: error: unsupported option '-fbasic-block-sections=all' for target 23f8878546SSriraman Tallam // CHECK-INVALID-VALUE: error: invalid value {{[^ ]*}} in '-fbasic-block-sections={{.*}}' 24f8878546SSriraman Tallam // CHECK-OPT-NULL-LIST: "-fbasic-block-sections=list=" 25cab5f89cSArtem Belevich 26cab5f89cSArtem Belevich // GPU-side compilations should have no -fbasic-block-sections. It should only 27cab5f89cSArtem Belevich // be passed to the host compilation 28cab5f89cSArtem Belevich // CHECK-CUDA-NOT: -fbasic-block-sections= 29cab5f89cSArtem Belevich // CHECK-CUDA: "-cc1" "-triple" "x86_64" 30cab5f89cSArtem Belevich // CHECK-CUDA-SAME: "-fbasic-block-sections=all" 31