================ @@ -0,0 +1,90 @@ +// Default cf-branch-label-scheme is func-sig +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_zicfilp1p0 -fcf-protection=branch -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-FUNC-SIG %s +// RUN: %clang --target=riscv64 -menable-experimental-extensions \ +// RUN: -march=rv64i_zicfilp1p0 -fcf-protection=branch -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-FUNC-SIG %s + +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_zicfilp1p0 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=unlabeled -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-UNLABELED %s + +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_zicfilp1p0 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=func-sig -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-FUNC-SIG %s + +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_zicfilp1p0 -mcf-branch-label-scheme=unlabeled -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNLABELED-SCHEME-UNUSED %s + +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_zicfilp1p0 -mcf-branch-label-scheme=func-sig -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FUNC-SIG-SCHEME-UNUSED %s + +// RUN: not %clang --target=riscv32 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=unlabeled -c %s -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s + +// RUN: not %clang --target=riscv32 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=func-sig -c %s -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s + +// RUN: %clang --target=riscv32 -mcf-branch-label-scheme=unlabeled -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNLABELED-SCHEME-UNUSED %s + +// RUN: %clang --target=riscv32 -mcf-branch-label-scheme=func-sig -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FUNC-SIG-SCHEME-UNUSED %s + +// RUN: %clang --target=riscv64 -menable-experimental-extensions \ +// RUN: -march=rv64i_zicfilp1p0 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=unlabeled -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-UNLABELED %s + +// RUN: %clang --target=riscv64 -menable-experimental-extensions \ +// RUN: -march=rv64i_zicfilp1p0 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=func-sig -E -dM %s -o - \ +// RUN: | FileCheck --check-prefix=CHECK-ZICFILP-FUNC-SIG %s + +// RUN: %clang --target=riscv64 -menable-experimental-extensions \ +// RUN: -march=rv64i_zicfilp1p0 -mcf-branch-label-scheme=unlabeled -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNLABELED-SCHEME-UNUSED %s + +// RUN: %clang --target=riscv64 -menable-experimental-extensions \ +// RUN: -march=rv64i_zicfilp1p0 -mcf-branch-label-scheme=func-sig -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FUNC-SIG-SCHEME-UNUSED %s + +// RUN: not %clang --target=riscv64 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=unlabeled -c %s -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s + +// RUN: not %clang --target=riscv64 -fcf-protection=branch \ +// RUN: -mcf-branch-label-scheme=func-sig -c %s -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s + +// RUN: %clang --target=riscv64 -mcf-branch-label-scheme=unlabeled -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNLABELED-SCHEME-UNUSED %s + +// RUN: %clang --target=riscv64 -mcf-branch-label-scheme=func-sig -c %s \ +// RUN: -o /dev/null 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FUNC-SIG-SCHEME-UNUSED %s + +// CHECK-ZICFILP-UNLABELED-DAG: __riscv_landing_pad 1{{$}} +// CHECK-ZICFILP-UNLABELED-DAG: __riscv_landing_pad_unlabeled 1{{$}} +// CHECK-ZICFILP-FUNC-SIG-DAG: __riscv_landing_pad 1{{$}} +// CHECK-ZICFILP-FUNC-SIG-DAG: __riscv_landing_pad_func_sig 1{{$}} ---------------- kito-cheng wrote:
Curious why suffix with `-DAG`? https://github.com/llvm/llvm-project/pull/109600 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits