From b09903f791eb849dfdd515c4086a10be658b5c1b Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 5 Dec 2025 04:46:20 -0500 Subject: [PATCH] bench: Disambiguate benchmark names in `mem_icount` The latest release of gungraun uses global symbols to register tests. Since it doesn't know about modules, these conflict. Add the module name so this isn't an issue, but keep the modules around because they are useful for organization. --- .../builtins-test/benches/mem_icount.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/library/compiler-builtins/builtins-test/benches/mem_icount.rs b/library/compiler-builtins/builtins-test/benches/mem_icount.rs index 966ceea86d8d..37595e825843 100644 --- a/library/compiler-builtins/builtins-test/benches/mem_icount.rs +++ b/library/compiler-builtins/builtins-test/benches/mem_icount.rs @@ -108,7 +108,7 @@ mod mcpy { ], setup = setup, )] - fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { + fn bench_cpy((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { unsafe { black_box(memcpy( black_box(dst.as_mut_ptr()), @@ -118,7 +118,7 @@ mod mcpy { } } - library_benchmark_group!(name = memcpy; benchmarks = bench); + library_benchmark_group!(name = memcpy; benchmarks = bench_cpy); } mod mset { @@ -157,7 +157,7 @@ mod mset { ], setup = setup, )] - fn bench((len, mut dst): (usize, AlignedSlice)) { + fn bench_set((len, mut dst): (usize, AlignedSlice)) { unsafe { black_box(memset( black_box(dst.as_mut_ptr()), @@ -167,7 +167,7 @@ mod mset { } } - library_benchmark_group!(name = memset; benchmarks = bench); + library_benchmark_group!(name = memset; benchmarks = bench_set); } mod mcmp { @@ -225,7 +225,7 @@ mod mcmp { ], setup = setup )] - fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { + fn bench_cmp((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) { unsafe { black_box(memcmp( black_box(dst.as_mut_ptr()), @@ -235,7 +235,7 @@ mod mcmp { } } - library_benchmark_group!(name = memcmp; benchmarks = bench); + library_benchmark_group!(name = memcmp; benchmarks = bench_cmp); } mod mmove { @@ -384,7 +384,7 @@ mod mmove { ], setup = setup_forward )] - fn forward((len, spread, mut buf): (usize, usize, AlignedSlice)) { + fn forward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) { // Test moving from the start of the buffer toward the end unsafe { black_box(memmove( @@ -478,7 +478,7 @@ mod mmove { ], setup = setup_backward )] - fn backward((len, spread, mut buf): (usize, usize, AlignedSlice)) { + fn backward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) { // Test moving from the end of the buffer toward the start unsafe { black_box(memmove( @@ -489,7 +489,7 @@ mod mmove { } } - library_benchmark_group!(name = memmove; benchmarks = forward, backward); + library_benchmark_group!(name = memmove; benchmarks = forward_move, backward_move); } use mcmp::memcmp;