Skip to content

Commit f00f0e6

Browse files
committed
Don't shadow the provided stringify! macro in a wasm code size test case
1 parent 8fea705 commit f00f0e6

File tree

1 file changed

+17
-23
lines changed
  • src/test/run-make/wasm-stringify-ints-small

1 file changed

+17
-23
lines changed

src/test/run-make/wasm-stringify-ints-small/foo.rs

100755100644
+17-23
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22

33
extern "C" {
44
fn observe(ptr: *const u8, len: usize);
5-
6-
fn get_u8() -> u8;
7-
fn get_i8() -> i8;
8-
fn get_u16() -> u16;
9-
fn get_i16() -> i16;
10-
fn get_u32() -> u32;
11-
fn get_i32() -> i32;
12-
fn get_u64() -> u64;
13-
fn get_i64() -> i64;
14-
fn get_usize() -> usize;
15-
fn get_isize() -> isize;
165
}
176

18-
macro_rules! stringify {
19-
( $($f:ident)* ) => {
7+
macro_rules! s {
8+
( $( $f:ident -> $t:ty );* $(;)* ) => {
209
$(
10+
extern "C" {
11+
fn $f() -> $t;
12+
}
2113
let s = $f().to_string();
2214
observe(s.as_ptr(), s.len());
2315
)*
@@ -26,14 +18,16 @@ macro_rules! stringify {
2618

2719
#[no_mangle]
2820
pub unsafe extern "C" fn foo() {
29-
stringify!(get_u8);
30-
stringify!(get_i8);
31-
stringify!(get_u16);
32-
stringify!(get_i16);
33-
stringify!(get_u32);
34-
stringify!(get_i32);
35-
stringify!(get_u64);
36-
stringify!(get_i64);
37-
stringify!(get_usize);
38-
stringify!(get_isize);
21+
s! {
22+
get_u8 -> u8;
23+
get_i8 -> i8;
24+
get_u16 -> u16;
25+
get_i16 -> i16;
26+
get_u32 -> u32;
27+
get_i32 -> i32;
28+
get_u64 -> u64;
29+
get_i64 -> i64;
30+
get_usize -> usize;
31+
get_isize -> isize;
32+
}
3933
}

0 commit comments

Comments
 (0)