about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-08-20 23:30:47 +0800
committerDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-08-29 21:48:48 +0800
commit9c29b33c7e6b02acc00965b0816c5cc8b4843e5e (patch)
tree16c3e177715e1f451631b9ff5707165b62442f3f /tests/codegen
parent6cf068db566de080dfa7ed24a216ea3aed2b98ce (diff)
downloadrust-9c29b33c7e6b02acc00965b0816c5cc8b4843e5e.tar.gz
rust-9c29b33c7e6b02acc00965b0816c5cc8b4843e5e.zip
riscv64imac: allow shadow call stack sanitizer
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/sanitizer/riscv64-shadow-call-stack.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs b/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs
new file mode 100644
index 00000000000..5833b832ba4
--- /dev/null
+++ b/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs
@@ -0,0 +1,17 @@
+//@ 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]
+
+#[lang = "sized"]
+trait Sized {}
+
+// CHECK: ; Function Attrs:{{.*}}shadowcallstack
+// CHECK: define dso_local void @foo() unnamed_addr #0
+#[no_mangle]
+pub fn foo() {}
+
+// CHECK: attributes #0 = {{.*}}shadowcallstack{{.*}}