[clang] [clang][RISCV][Zicfilp] Force user to use `-mcf-branch-label-scheme=unlabeled` (PR #152122)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 5 13:58:20 PDT 2025


================
@@ -71,21 +71,24 @@
 // RUN: --check-prefixes=NO-FLAG,FUNC-SIG-SCHEME-UNUSED %s
 
 // Default -mcf-branch-label-scheme is func-sig
-// RUN: %clang --target=riscv32 -fcf-protection=branch -S -emit-llvm %s -o - \
-// RUN: | FileCheck --check-prefixes=BRANCH-PROT-FLAG,FUNC-SIG-FLAG %s
+// RUN: not %clang --target=riscv32 -fcf-protection=branch -S -emit-llvm %s 2>&1 \
+// RUN: | FileCheck --check-prefixes=FORCE-UNLABELED %s
 
 // Default -mcf-branch-label-scheme is func-sig
-// RUN: %clang --target=riscv64 -fcf-protection=branch -S -emit-llvm %s -o - \
-// RUN: | FileCheck --check-prefixes=BRANCH-PROT-FLAG,FUNC-SIG-FLAG %s
+// RUN: not %clang --target=riscv64 -fcf-protection=branch -S -emit-llvm %s 2>&1 \
+// RUN: | FileCheck --check-prefixes=FORCE-UNLABELED %s
 
 // UNLABELED-SCHEME-UNUSED: warning: argument unused during compilation:
 // UNLABELED-SCHEME-UNUSED-SAME: '-mcf-branch-label-scheme=unlabeled'
 // FUNC-SIG-SCHEME-UNUSED: warning: argument unused during compilation:
 // FUNC-SIG-SCHEME-UNUSED-SAME: '-mcf-branch-label-scheme=func-sig'
+// FUNC-SIG-NOSUPPORT: error: option 'mcf-branch-label-scheme=func-sig' is
+// FUNC-SIG-NOSUPPORT-SAME: unsupported; consider using 'mcf-branch-label-scheme=unlabeled'
+// FORCE-UNLABELED: error: option 'fcf-protection=branch' cannot be specified
+// FORCE-UNLABELED-SAME: without 'mcf-branch-label-scheme=unlabeled'
----------------
lenary wrote:

Please include the full option name, with the hyphen.

https://github.com/llvm/llvm-project/pull/152122


More information about the cfe-commits mailing list