40 lines · plain
1;; Check that shadow call stack doesn't interfere with save/restore2 3; RUN: llc -mtriple=riscv32 < %s | FileCheck %s -check-prefix=RV32I4; RUN: llc -mtriple=riscv64 < %s | FileCheck %s -check-prefix=RV64I5; RUN: llc -mtriple=riscv32 -mattr=+save-restore < %s | FileCheck %s -check-prefix=RV32I-SR6; RUN: llc -mtriple=riscv64 -mattr=+save-restore < %s | FileCheck %s -check-prefix=RV64I-SR7; RUN: llc -mtriple=riscv32 -mattr=+f,+save-restore -target-abi=ilp32f < %s | FileCheck %s -check-prefix=RV32I-FP-SR8; RUN: llc -mtriple=riscv64 -mattr=+f,+d,+save-restore -target-abi=lp64d < %s | FileCheck %s -check-prefix=RV64I-FP-SR9 10@var2 = global [30 x i32] zeroinitializer11 12define void @callee_scs() nounwind shadowcallstack {13; RV32I-LABEL: callee_scs:14; RV32I-NOT: call t0, __riscv_save15; RV32I-NOT: tail __riscv_restore16;17; RV64I-LABEL: callee_scs:18; RV64I-NOT: call t0, __riscv_save19; RV64I-NOT: tail __riscv_restore20;21; RV32I-SR-LABEL: callee_scs:22; RV32I-SR: call t0, __riscv_save_1223; RV32I-SR: tail __riscv_restore_1224;25; RV64I-SR-LABEL: callee_scs:26; RV64I-SR: call t0, __riscv_save_1227; RV64I-SR: tail __riscv_restore_1228;29; RV32I-FP-SR-LABEL: callee_scs:30; RV32I-FP-SR: call t0, __riscv_save_1231; RV32I-FP-SR: tail __riscv_restore_1232;33; RV64I-FP-SR-LABEL: callee_scs:34; RV64I-FP-SR: call t0, __riscv_save_1235; RV64I-FP-SR: tail __riscv_restore_1236 %val = load [30 x i32], ptr @var237 store volatile [30 x i32] %val, ptr @var238 ret void39}40