mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
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.
35 lines
1.5 KiB
Rust
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 {{.*}} }
|
|
}
|