diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-04-14 13:29:42 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-24 16:28:57 +0000 |
| commit | d5ffe11cd904ef780d68925fcaa7a9ee57c83832 (patch) | |
| tree | 28896e6e682cafe84fcc60a0fa20d133771dacc5 | |
| parent | ac6b7083c8e15c9f2043b29592b30534f2d94f22 (diff) | |
| download | rust-d5ffe11cd904ef780d68925fcaa7a9ee57c83832.tar.gz rust-d5ffe11cd904ef780d68925fcaa7a9ee57c83832.zip | |
Make a test independent of 64/32 bit
| -rw-r--r-- | src/test/ui/asm/naked-functions.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/asm/naked-functions.stderr | 16 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/test/ui/asm/naked-functions.rs b/src/test/ui/asm/naked-functions.rs index 3ecf408b3c7..9e626f5711d 100644 --- a/src/test/ui/asm/naked-functions.rs +++ b/src/test/ui/asm/naked-functions.rs @@ -37,11 +37,11 @@ pub unsafe extern "C" fn inc(a: u32) -> u32 { } #[naked] +#[allow(asm_sub_register)] pub unsafe extern "C" fn inc_asm(a: u32) -> u32 { asm!("/* {0} */", in(reg) a, options(noreturn)); //~^ ERROR referencing function parameters is not allowed in naked functions //~| ERROR only `const` and `sym` operands are supported in naked functions - //~| WARN formatting may not be suitable for sub-register argument [asm_sub_register] } #[naked] diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr index 52feed466b3..1828066b692 100644 --- a/src/test/ui/asm/naked-functions.stderr +++ b/src/test/ui/asm/naked-functions.stderr @@ -66,7 +66,7 @@ LL | | } | |_^ error: referencing function parameters is not allowed in naked functions - --> $DIR/naked-functions.rs:41:31 + --> $DIR/naked-functions.rs:42:31 | LL | asm!("/* {0} */", in(reg) a, options(noreturn)); | ^ @@ -74,7 +74,7 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn)); = help: follow the calling convention in asm block to use parameters error[E0787]: only `const` and `sym` operands are supported in naked functions - --> $DIR/naked-functions.rs:41:23 + --> $DIR/naked-functions.rs:42:23 | LL | asm!("/* {0} */", in(reg) a, options(noreturn)); | ^^^^^^^^^ @@ -298,16 +298,6 @@ error: naked functions cannot be inlined LL | #[inline(never)] | ^^^^^^^^^^^^^^^^ -warning: formatting may not be suitable for sub-register argument - --> $DIR/naked-functions.rs:41:14 - | -LL | asm!("/* {0} */", in(reg) a, options(noreturn)); - | ^^^ - for this argument - | - = note: `#[warn(asm_sub_register)]` on by default - = help: use the `e` modifier to have the register formatted as `eax` - = help: or use the `r` modifier to keep the default formatting of `rax` - -error: aborting due to 33 previous errors; 3 warnings emitted +error: aborting due to 33 previous errors; 2 warnings emitted For more information about this error, try `rustc --explain E0787`. |
