Files
rust/tests/codegen-llvm/stack-protector.rs
Ariel Ben-Yehuda 3d8a17acdb Make partial -Z stack-protector a future-compat warning by default in all editions
This enables RFC 3855 for stack-protector. With this PR, uses of stack-protector
that only have it enabled for a subset of the crates within a process need to pass
`-Z allow-partial-mitigations=stack-protector` as well.

This uses a future-incompat warning to avoid breaking people.

This was not done in issue 149357 to allow for a smooth transition period.

cc the stack-protector tracking issue at issue 114903.
2026-10-06 14:23:04 +03:00

35 lines
1.5 KiB
Rust

//@ revisions: all strong basic none
//@ ignore-nvptx64 stack protector not supported
//@ [all] compile-flags: -Z stack-protector=all -Z allow-partial-mitigations=stack-protector
//@ [strong] compile-flags: -Z stack-protector=strong -Z allow-partial-mitigations=stack-protector
//@ [basic] compile-flags: -Z stack-protector=basic -Z allow-partial-mitigations=stack-protector
#![crate_type = "lib"]
#[no_mangle]
pub fn foo() {
// CHECK: @foo() unnamed_addr #0
// all-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
// all-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
// all: attributes #0 = { {{.*}}sspreq {{.*}} }
// all-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
// all-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
// strong-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
// strong-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
// strong: attributes #0 = { {{.*}}sspstrong {{.*}} }
// strong-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
// strong-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
// basic-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
// basic-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
// basic: attributes #0 = { {{.*}}ssp {{.*}} }
// basic-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
// basic-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
// none-NOT: attributes #0 = { {{.*}}sspreq {{.*}} }
// none-NOT: attributes #0 = { {{.*}}sspstrong {{.*}} }
// none-NOT: attributes #0 = { {{.*}}ssp {{.*}} }
}