Skip to content

Commit

Permalink
Remove ui tests for LLVM-style inline assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Jan 12, 2022
1 parent a76577c commit 61c233b
Show file tree
Hide file tree
Showing 70 changed files with 74 additions and 1,500 deletions.
12 changes: 0 additions & 12 deletions src/test/ui/asm/naked-functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
// ignore-spirv
// ignore-wasm32

#![feature(llvm_asm)]
#![feature(naked_functions)]
#![feature(or_patterns)]
#![feature(asm_const, asm_sym)]
#![crate_type = "lib"]
#![allow(deprecated)] // llvm_asm!

use std::arch::asm;

Expand Down Expand Up @@ -114,16 +112,6 @@ pub fn outer(x: u32) -> extern "C" fn(usize) -> usize {
inner
}

#[naked]
unsafe extern "C" fn llvm() -> ! {
//~^ WARN naked functions must contain a single asm block
//~| WARN this was previously accepted
llvm_asm!("");
//~^ WARN LLVM-style inline assembly is unsupported in naked functions
//~| WARN this was previously accepted
core::hint::unreachable_unchecked();
}

#[naked]
unsafe extern "C" fn invalid_options() {
asm!("", options(nomem, preserves_flags, noreturn));
Expand Down
91 changes: 32 additions & 59 deletions src/test/ui/asm/naked-functions.stderr
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
error: asm with the `pure` option must have at least one output
--> $DIR/naked-functions.rs:136:14
--> $DIR/naked-functions.rs:124:14
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^

error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:23:5
--> $DIR/naked-functions.rs:21:5
|
LL | mut a: u32,
| ^^^^^

error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:25:5
--> $DIR/naked-functions.rs:23:5
|
LL | &b: &i32,
| ^^

error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:27:6
--> $DIR/naked-functions.rs:25:6
|
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
| ^^^^^^^^^^^^^^

error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:29:5
--> $DIR/naked-functions.rs:27:5
|
LL | P { x, y }: P,
| ^^^^^^^^^^

error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:39:5
--> $DIR/naked-functions.rs:37:5
|
LL | a + 1
| ^
|
= help: follow the calling convention in asm block to use parameters

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:36:1
--> $DIR/naked-functions.rs:34:1
|
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
LL | |
Expand All @@ -53,15 +53,15 @@ LL | | }
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:45:31
--> $DIR/naked-functions.rs:43:31
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^
|
= help: follow the calling convention in asm block to use parameters

warning: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:45:23
--> $DIR/naked-functions.rs:43:23
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^^^^^^^^^
Expand All @@ -70,7 +70,7 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:52:1
--> $DIR/naked-functions.rs:50:1
|
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
LL | |
Expand All @@ -84,7 +84,7 @@ LL | | }
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:72:10
--> $DIR/naked-functions.rs:70:10
|
LL | in(reg) a,
| ^^^^^^^^^
Expand All @@ -102,7 +102,7 @@ LL | out(reg) e,
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:69:5
--> $DIR/naked-functions.rs:67:5
|
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
LL | |
Expand All @@ -117,7 +117,7 @@ LL | | );
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:59:1
--> $DIR/naked-functions.rs:57:1
|
LL | / pub unsafe extern "C" fn unsupported_operands() {
LL | |
Expand All @@ -141,7 +141,7 @@ LL | | }
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:85:1
--> $DIR/naked-functions.rs:83:1
|
LL | / pub extern "C" fn missing_assembly() {
LL | |
Expand All @@ -153,7 +153,7 @@ LL | | }
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:94:5
--> $DIR/naked-functions.rs:92:5
|
LL | asm!("");
| ^^^^^^^^
Expand All @@ -162,7 +162,7 @@ LL | asm!("");
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:97:5
--> $DIR/naked-functions.rs:95:5
|
LL | asm!("");
| ^^^^^^^^
Expand All @@ -171,7 +171,7 @@ LL | asm!("");
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:100:5
--> $DIR/naked-functions.rs:98:5
|
LL | asm!("");
| ^^^^^^^^
Expand All @@ -180,7 +180,7 @@ LL | asm!("");
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:91:1
--> $DIR/naked-functions.rs:89:1
|
LL | / pub extern "C" fn too_many_asm_blocks() {
LL | |
Expand All @@ -202,15 +202,15 @@ LL | | }
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:111:11
--> $DIR/naked-functions.rs:109:11
|
LL | *&y
| ^
|
= help: follow the calling convention in asm block to use parameters

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:108:5
--> $DIR/naked-functions.rs:106:5
|
LL | / pub extern "C" fn inner(y: usize) -> usize {
LL | |
Expand All @@ -224,35 +224,8 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: the LLVM-style inline assembly is unsupported in naked functions
--> $DIR/naked-functions.rs:121:5
|
LL | llvm_asm!("");
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
= help: use the new asm! syntax specified in RFC 2873
= note: this warning originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:118:1
|
LL | / unsafe extern "C" fn llvm() -> ! {
LL | |
LL | |
LL | | llvm_asm!("");
... |
LL | | core::hint::unreachable_unchecked();
| | ------------------------------------ non-asm is unsupported in naked functions
LL | | }
| |_^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm options unsupported in naked functions: `nomem`, `preserves_flags`
--> $DIR/naked-functions.rs:129:5
--> $DIR/naked-functions.rs:117:5
|
LL | asm!("", options(nomem, preserves_flags, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -261,7 +234,7 @@ LL | asm!("", options(nomem, preserves_flags, noreturn));
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
--> $DIR/naked-functions.rs:136:5
--> $DIR/naked-functions.rs:124:5
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -270,7 +243,7 @@ LL | asm!("", options(readonly, nostack), options(pure));
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:136:5
--> $DIR/naked-functions.rs:124:5
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -279,21 +252,21 @@ LL | asm!("", options(readonly, nostack), options(pure));
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:145:15
--> $DIR/naked-functions.rs:133:15
|
LL | pub unsafe fn default_abi() {
| ^^^^^^^^^^^
|
= note: `#[warn(undefined_naked_function_abi)]` on by default

warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:151:15
--> $DIR/naked-functions.rs:139:15
|
LL | pub unsafe fn rust_abi() {
| ^^^^^^^^

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:191:1
--> $DIR/naked-functions.rs:179:1
|
LL | #[inline]
| ^^^^^^^^^
Expand All @@ -302,7 +275,7 @@ LL | #[inline]
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:199:1
--> $DIR/naked-functions.rs:187:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -311,7 +284,7 @@ LL | #[inline(always)]
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:207:1
--> $DIR/naked-functions.rs:195:1
|
LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^
Expand All @@ -320,7 +293,7 @@ LL | #[inline(never)]
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:215:1
--> $DIR/naked-functions.rs:203:1
|
LL | #[inline]
| ^^^^^^^^^
Expand All @@ -329,7 +302,7 @@ LL | #[inline]
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:218:1
--> $DIR/naked-functions.rs:206:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -338,13 +311,13 @@ LL | #[inline(always)]
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

warning: naked functions cannot be inlined
--> $DIR/naked-functions.rs:221:1
--> $DIR/naked-functions.rs:209:1
|
LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>

error: aborting due to 8 previous errors; 25 warnings emitted
error: aborting due to 8 previous errors; 23 warnings emitted

9 changes: 0 additions & 9 deletions src/test/ui/ast-json/ast-json-ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// check-pass
// dont-check-compiler-stdout - don't check for any AST change.

#![feature(llvm_asm)]
#![allow(deprecated)] // llvm_asm!

enum V {
A(i32),
B { f: [i64; 3 + 4] }
Expand All @@ -27,12 +24,6 @@ macro_rules! call_println {
}

fn main() {
#[cfg(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64"))]
unsafe { llvm_asm!(""::::); }

let x: (i32) = 35;
let y = x as i64<> + 5;

Expand Down
Loading

0 comments on commit 61c233b

Please sign in to comment.