2022-06-17 18:14:58 +00:00
|
|
|
// This tests that the shadowcallstack attribute is
|
|
|
|
// applied when enabling the shadow-call-stack sanitizer.
|
|
|
|
//
|
|
|
|
// needs-sanitizer-shadow-call-stack
|
|
|
|
// compile-flags: -Zsanitizer=shadow-call-stack
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(no_sanitize)]
|
|
|
|
|
2022-10-06 04:46:44 +00:00
|
|
|
// CHECK: ; sanitizer_scs_attr_check::scs
|
|
|
|
// CHECK-NEXT: ; Function Attrs:{{.*}}shadowcallstack
|
2022-06-17 18:14:58 +00:00
|
|
|
pub fn scs() {}
|
|
|
|
|
2022-10-06 04:46:44 +00:00
|
|
|
// CHECK: ; sanitizer_scs_attr_check::no_scs
|
2022-06-17 18:14:58 +00:00
|
|
|
// CHECK-NOT: ; Function Attrs:{{.*}}shadowcallstack
|
|
|
|
#[no_sanitize(shadow_call_stack)]
|
|
|
|
pub fn no_scs() {}
|