Skip to content

Commit a5f6e71

Browse files
committed
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.
1 parent db3e11e commit a5f6e71

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

builtins-test/benches/mem_icount.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ mod mcpy {
108108
],
109109
setup = setup,
110110
)]
111-
fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
111+
fn bench_cpy((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
112112
unsafe {
113113
black_box(memcpy(
114114
black_box(dst.as_mut_ptr()),
@@ -118,7 +118,7 @@ mod mcpy {
118118
}
119119
}
120120

121-
library_benchmark_group!(name = memcpy; benchmarks = bench);
121+
library_benchmark_group!(name = memcpy; benchmarks = bench_cpy);
122122
}
123123

124124
mod mset {
@@ -157,7 +157,7 @@ mod mset {
157157
],
158158
setup = setup,
159159
)]
160-
fn bench((len, mut dst): (usize, AlignedSlice)) {
160+
fn bench_set((len, mut dst): (usize, AlignedSlice)) {
161161
unsafe {
162162
black_box(memset(
163163
black_box(dst.as_mut_ptr()),
@@ -167,7 +167,7 @@ mod mset {
167167
}
168168
}
169169

170-
library_benchmark_group!(name = memset; benchmarks = bench);
170+
library_benchmark_group!(name = memset; benchmarks = bench_set);
171171
}
172172

173173
mod mcmp {
@@ -225,7 +225,7 @@ mod mcmp {
225225
],
226226
setup = setup
227227
)]
228-
fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
228+
fn bench_cmp((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
229229
unsafe {
230230
black_box(memcmp(
231231
black_box(dst.as_mut_ptr()),
@@ -235,7 +235,7 @@ mod mcmp {
235235
}
236236
}
237237

238-
library_benchmark_group!(name = memcmp; benchmarks = bench);
238+
library_benchmark_group!(name = memcmp; benchmarks = bench_cmp);
239239
}
240240

241241
mod mmove {
@@ -384,7 +384,7 @@ mod mmove {
384384
],
385385
setup = setup_forward
386386
)]
387-
fn forward((len, spread, mut buf): (usize, usize, AlignedSlice)) {
387+
fn forward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) {
388388
// Test moving from the start of the buffer toward the end
389389
unsafe {
390390
black_box(memmove(
@@ -478,7 +478,7 @@ mod mmove {
478478
],
479479
setup = setup_backward
480480
)]
481-
fn backward((len, spread, mut buf): (usize, usize, AlignedSlice)) {
481+
fn backward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) {
482482
// Test moving from the end of the buffer toward the start
483483
unsafe {
484484
black_box(memmove(
@@ -489,7 +489,7 @@ mod mmove {
489489
}
490490
}
491491

492-
library_benchmark_group!(name = memmove; benchmarks = forward, backward);
492+
library_benchmark_group!(name = memmove; benchmarks = forward_move, backward_move);
493493
}
494494

495495
use mcmp::memcmp;

0 commit comments

Comments
 (0)