about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-07-29 23:10:34 +0800
committerDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-08-09 19:35:02 +0800
commitb368dcb246c5aedb087034e0f62941d038799f38 (patch)
tree6feffd37a0fe174be9d5746685bd143653301e15 /tests/codegen
parent8c7e0e160831866bc1a40691a39455aac21271c0 (diff)
downloadrust-b368dcb246c5aedb087034e0f62941d038799f38.tar.gz
rust-b368dcb246c5aedb087034e0f62941d038799f38.zip
unconditionally allow shadow call-stack for AArch64 whenever fixed-x18 is applied
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs b/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
new file mode 100644
index 00000000000..e2e14ab14a8
--- /dev/null
+++ b/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
@@ -0,0 +1,19 @@
+//@ revisions: aarch64 android
+//@[aarch64] compile-flags: --target aarch64-unknown-none -Zfixed-x18 -Zsanitizer=shadow-call-stack
+//@[aarch64] needs-llvm-components: aarch64
+//@[android] compile-flags: --target aarch64-linux-android -Zsanitizer=shadow-call-stack
+//@[android] needs-llvm-components: aarch64
+
+#![allow(internal_features)]
+#![crate_type = "rlib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+// CHECK: ; Function Attrs:{{.*}}shadowcallstack
+#[no_mangle]
+pub fn foo() {}
+
+// CHECK: attributes #0 = {{.*}}shadowcallstack{{.*}}