Rollup merge of #136938 - mustartt:fix-stack-protector-filecheck, r=Mark-Simulacrum

Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern

With function sections, the assembly label does not necessarily end in `:`.

Remove trailing `:` to be more consistent with the rest of the existing Filecheck patterns.
```
// CHECK-LABEL: local_string_addr_taken
#[no_mangle]
pub fn local_string_addr_taken(f: fn(&String)) {
    let x = String::new();
    f(&x);
```
This commit is contained in:
Matthias Krüger 2025-03-03 10:40:58 +01:00 committed by GitHub
commit f71b6ebb49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,7 @@
#![allow(incomplete_features)]
#![feature(unsized_locals, unsized_fn_params)]
// CHECK-LABEL: emptyfn:
// CHECK-LABEL: emptyfn{{:|\[}}
#[no_mangle]
pub fn emptyfn() {
// all: __stack_chk_fail
@ -29,7 +29,7 @@ pub fn emptyfn() {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: array_char
// CHECK-LABEL: array_char{{:|\[}}
#[no_mangle]
pub fn array_char(f: fn(*const char)) {
let a = ['c'; 1];
@ -47,7 +47,7 @@ pub fn array_char(f: fn(*const char)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: array_u8_1
// CHECK-LABEL: array_u8_1{{:|\[}}
#[no_mangle]
pub fn array_u8_1(f: fn(*const u8)) {
let a = [0u8; 1];
@ -63,7 +63,7 @@ pub fn array_u8_1(f: fn(*const u8)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: array_u8_small:
// CHECK-LABEL: array_u8_small{{:|\[}}
#[no_mangle]
pub fn array_u8_small(f: fn(*const u8)) {
let a = [0u8; 2];
@ -80,7 +80,7 @@ pub fn array_u8_small(f: fn(*const u8)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: array_u8_large:
// CHECK-LABEL: array_u8_large{{:|\[}}
#[no_mangle]
pub fn array_u8_large(f: fn(*const u8)) {
let a = [0u8; 9];
@ -99,7 +99,7 @@ pub fn array_u8_large(f: fn(*const u8)) {
#[derive(Copy, Clone)]
pub struct ByteSizedNewtype(u8);
// CHECK-LABEL: array_bytesizednewtype_9:
// CHECK-LABEL: array_bytesizednewtype_9{{:|\[}}
#[no_mangle]
pub fn array_bytesizednewtype_9(f: fn(*const ByteSizedNewtype)) {
let a = [ByteSizedNewtype(0); 9];
@ -115,7 +115,7 @@ pub fn array_bytesizednewtype_9(f: fn(*const ByteSizedNewtype)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: local_var_addr_used_indirectly
// CHECK-LABEL: local_var_addr_used_indirectly{{:|\[}}
#[no_mangle]
pub fn local_var_addr_used_indirectly(f: fn(bool)) {
let a = 5;
@ -142,7 +142,7 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: local_string_addr_taken
// CHECK-LABEL: local_string_addr_taken{{:|\[}}
#[no_mangle]
pub fn local_string_addr_taken(f: fn(&String)) {
let x = String::new();
@ -168,7 +168,7 @@ impl SelfByRef for i32 {
}
}
// CHECK-LABEL: local_var_addr_taken_used_locally_only
// CHECK-LABEL: local_var_addr_taken_used_locally_only{{:|\[}}
#[no_mangle]
pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32)) {
let x = factory();
@ -195,7 +195,7 @@ pub struct Gigastruct {
members: u64,
}
// CHECK-LABEL: local_large_var_moved
// CHECK-LABEL: local_large_var_moved{{:|\[}}
#[no_mangle]
pub fn local_large_var_moved(f: fn(Gigastruct)) {
let x = Gigastruct { does: 0, not: 1, have: 2, array: 3, members: 4 };
@ -224,7 +224,7 @@ pub fn local_large_var_moved(f: fn(Gigastruct)) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: local_large_var_cloned
// CHECK-LABEL: local_large_var_cloned{{:|\[}}
#[no_mangle]
pub fn local_large_var_cloned(f: fn(Gigastruct)) {
f(Gigastruct { does: 0, not: 1, have: 2, array: 3, members: 4 });
@ -281,7 +281,7 @@ extern "C" {
fn alloca(size: usize) -> *mut ();
}
// CHECK-LABEL: alloca_small_compile_time_constant_arg
// CHECK-LABEL: alloca_small_compile_time_constant_arg{{:|\[}}
#[no_mangle]
pub fn alloca_small_compile_time_constant_arg(f: fn(*mut ())) {
f(unsafe { alloca(8) });
@ -293,7 +293,7 @@ pub fn alloca_small_compile_time_constant_arg(f: fn(*mut ())) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: alloca_large_compile_time_constant_arg
// CHECK-LABEL: alloca_large_compile_time_constant_arg{{:|\[}}
#[no_mangle]
pub fn alloca_large_compile_time_constant_arg(f: fn(*mut ())) {
f(unsafe { alloca(9) });
@ -305,7 +305,7 @@ pub fn alloca_large_compile_time_constant_arg(f: fn(*mut ())) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: alloca_dynamic_arg
// CHECK-LABEL: alloca_dynamic_arg{{:|\[}}
#[no_mangle]
pub fn alloca_dynamic_arg(f: fn(*mut ()), n: usize) {
f(unsafe { alloca(n) });
@ -324,7 +324,7 @@ pub fn alloca_dynamic_arg(f: fn(*mut ()), n: usize) {
// this is support for the "unsized locals" unstable feature:
// https://doc.rust-lang.org/unstable-book/language-features/unsized-locals.html.
// CHECK-LABEL: unsized_fn_param
// CHECK-LABEL: unsized_fn_param{{:|\[}}
#[no_mangle]
pub fn unsized_fn_param(s: [u8], l: bool, f: fn([u8])) {
let n = if l { 1 } else { 2 };
@ -344,7 +344,7 @@ pub fn unsized_fn_param(s: [u8], l: bool, f: fn([u8])) {
// missing-NOT: __stack_chk_fail
}
// CHECK-LABEL: unsized_local
// CHECK-LABEL: unsized_local{{:|\[}}
#[no_mangle]
pub fn unsized_local(s: &[u8], l: bool, f: fn(&mut [u8])) {
let n = if l { 1 } else { 2 };