Skip to content

Commit

Permalink
sanitizer: Fix scs-attr check test
Browse files Browse the repository at this point in the history
This test was not actually being run before - it only runs on targets
with SCS enabled, which is limited to `aarch64-linux-android` at the
moment. This means that the test has been sitting broken and needs to be
fixed before we can enable `aarch64-linux-android` in testing.

* Rename CHECK function names to match current crate name
* Disable optimization to prevent the functions from being made MIR-only
  • Loading branch information
maurer committed May 18, 2024
1 parent c00957a commit b32efa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/codegen/sanitizer/scs-attr-check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
//
//@ needs-sanitizer-shadow-call-stack
//@ compile-flags: -Zsanitizer=shadow-call-stack
// With optimization, Rust may decide to make these functions MIR-only.
//@ compile-flags: -C opt-level=0

#![crate_type = "lib"]
#![feature(no_sanitize)]

// CHECK: ; sanitizer_scs_attr_check::scs
// CHECK: ; scs_attr_check::scs
// CHECK-NEXT: ; Function Attrs:{{.*}}shadowcallstack
pub fn scs() {}

// CHECK: ; sanitizer_scs_attr_check::no_scs
// CHECK: ; scs_attr_check::no_scs
// CHECK-NOT: ; Function Attrs:{{.*}}shadowcallstack
#[no_sanitize(shadow_call_stack)]
pub fn no_scs() {}

0 comments on commit b32efa1

Please sign in to comment.