rust/tests/codegen/sanitizer-safestack-attr-check.rs
Wesley Wiser 019d75b44e Add SafeStack support to rustc
Adds support for LLVM [SafeStack] which provides backward edge control
flow protection by separating the stack into two parts: data which is
only accessed in provable safe ways is allocated on the normal stack
(the "safe stack") and all other data is placed in a separate allocation
(the "unsafe stack").

SafeStack support is enabled by passing `-Zsanitizer=safestack`.

[SafeStack]: https://clang.llvm.org/docs/SafeStack.html
2023-05-26 15:18:54 -04:00

12 lines
296 B
Rust

// This tests that the safestack attribute is applied when enabling the safe-stack sanitizer.
//
// needs-sanitizer-safestack
// compile-flags: -Zsanitizer=safestack
#![crate_type = "lib"]
// CHECK: ; Function Attrs:{{.*}}safestack
pub fn tagged() {}
// CHECK: attributes #0 = {{.*}}safestack