Skip to content

Commit d5ffe11

Browse files
committed
Make a test independent of 64/32 bit
1 parent ac6b708 commit d5ffe11

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/test/ui/asm/naked-functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ pub unsafe extern "C" fn inc(a: u32) -> u32 {
3737
}
3838

3939
#[naked]
40+
#[allow(asm_sub_register)]
4041
pub unsafe extern "C" fn inc_asm(a: u32) -> u32 {
4142
asm!("/* {0} */", in(reg) a, options(noreturn));
4243
//~^ ERROR referencing function parameters is not allowed in naked functions
4344
//~| ERROR only `const` and `sym` operands are supported in naked functions
44-
//~| WARN formatting may not be suitable for sub-register argument [asm_sub_register]
4545
}
4646

4747
#[naked]

src/test/ui/asm/naked-functions.stderr

+3-13
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ LL | | }
6666
| |_^
6767

6868
error: referencing function parameters is not allowed in naked functions
69-
--> $DIR/naked-functions.rs:41:31
69+
--> $DIR/naked-functions.rs:42:31
7070
|
7171
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
7272
| ^
7373
|
7474
= help: follow the calling convention in asm block to use parameters
7575

7676
error[E0787]: only `const` and `sym` operands are supported in naked functions
77-
--> $DIR/naked-functions.rs:41:23
77+
--> $DIR/naked-functions.rs:42:23
7878
|
7979
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
8080
| ^^^^^^^^^
@@ -298,16 +298,6 @@ error: naked functions cannot be inlined
298298
LL | #[inline(never)]
299299
| ^^^^^^^^^^^^^^^^
300300

301-
warning: formatting may not be suitable for sub-register argument
302-
--> $DIR/naked-functions.rs:41:14
303-
|
304-
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
305-
| ^^^ - for this argument
306-
|
307-
= note: `#[warn(asm_sub_register)]` on by default
308-
= help: use the `e` modifier to have the register formatted as `eax`
309-
= help: or use the `r` modifier to keep the default formatting of `rax`
310-
311-
error: aborting due to 33 previous errors; 3 warnings emitted
301+
error: aborting due to 33 previous errors; 2 warnings emitted
312302

313303
For more information about this error, try `rustc --explain E0787`.

0 commit comments

Comments
 (0)