about summary refs log tree commit diff
path: root/tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs')
-rw-r--r--tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs b/tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs
new file mode 100644
index 00000000000..945e46218d0
--- /dev/null
+++ b/tests/codegen-llvm/sanitizer/riscv64-shadow-call-stack.rs
@@ -0,0 +1,18 @@
+//@ add-core-stubs
+//@ compile-flags: --target riscv64imac-unknown-none-elf -Zsanitizer=shadow-call-stack
+//@ needs-llvm-components: riscv
+
+#![allow(internal_features)]
+#![crate_type = "rlib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+// CHECK: ; Function Attrs:{{.*}}shadowcallstack
+// CHECK: define dso_local void @foo() unnamed_addr #0
+#[no_mangle]
+pub fn foo() {}
+
+// CHECK: attributes #0 = {{.*}}shadowcallstack{{.*}}