summaryrefslogtreecommitdiffstats
path: root/src/test/ui/asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/asm')
-rw-r--r--src/test/ui/asm/aarch64/may_unwind.rs1
-rw-r--r--src/test/ui/asm/aarch64/type-check-3.stderr40
-rw-r--r--src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/may_unwind.rs1
-rw-r--r--src/test/ui/asm/naked-functions.stderr103
-rw-r--r--src/test/ui/asm/type-check-1.stderr4
-rw-r--r--src/test/ui/asm/unpretty-expanded.rs3
-rw-r--r--src/test/ui/asm/unpretty-expanded.stdout9
-rw-r--r--src/test/ui/asm/x86_64/may_unwind.rs2
-rw-r--r--src/test/ui/asm/x86_64/sym.rs1
-rw-r--r--src/test/ui/asm/x86_64/type-check-3.stderr16
14 files changed, 96 insertions, 100 deletions
diff --git a/src/test/ui/asm/aarch64/may_unwind.rs b/src/test/ui/asm/aarch64/may_unwind.rs
index ac8cc6202..dfd891b42 100644
--- a/src/test/ui/asm/aarch64/may_unwind.rs
+++ b/src/test/ui/asm/aarch64/may_unwind.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
// only-aarch64
// run-pass
// needs-asm-support
diff --git a/src/test/ui/asm/aarch64/type-check-3.stderr b/src/test/ui/asm/aarch64/type-check-3.stderr
index b320abdc0..49292982e 100644
--- a/src/test/ui/asm/aarch64/type-check-3.stderr
+++ b/src/test/ui/asm/aarch64/type-check-3.stderr
@@ -5,8 +5,8 @@ LL | asm!("{}", in(reg) 0u8);
| ^^ --- for this argument
|
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:50:15
@@ -14,8 +14,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0u16);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:52:15
@@ -23,8 +23,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0i32);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:54:15
@@ -32,8 +32,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0f32);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:57:15
@@ -41,8 +41,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0i16);
| ^^ ---- for this argument
|
- = help: use the `h` modifier to have the register formatted as `h0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:h}` to have the register formatted as `h0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:59:15
@@ -50,8 +50,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0f32);
| ^^ ---- for this argument
|
- = help: use the `s` modifier to have the register formatted as `s0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:s}` to have the register formatted as `s0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:61:15
@@ -59,8 +59,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0f64);
| ^^ ---- for this argument
|
- = help: use the `d` modifier to have the register formatted as `d0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:d}` to have the register formatted as `d0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:63:15
@@ -68,8 +68,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg_low16) 0f64);
| ^^ ---- for this argument
|
- = help: use the `d` modifier to have the register formatted as `d0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:d}` to have the register formatted as `d0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:66:15
@@ -77,8 +77,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0}", in(reg) 0i16);
| ^^^ ^^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:68:15
@@ -86,8 +86,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0:x}", in(reg) 0i16);
| ^^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
error: type `i128` cannot be used with this register class
--> $DIR/type-check-3.rs:73:28
diff --git a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
index 7ef93e15f..5dac693cc 100644
--- a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
@@ -190,8 +190,8 @@ LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
index 7ef93e15f..5dac693cc 100644
--- a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
@@ -190,8 +190,8 @@ LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
index 250bc3be4..b29b74bac 100644
--- a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
@@ -190,8 +190,8 @@ LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- 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`
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
index 250bc3be4..b29b74bac 100644
--- a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
@@ -190,8 +190,8 @@ LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- 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`
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/may_unwind.rs b/src/test/ui/asm/may_unwind.rs
index 117c0a63a..b9479c44b 100644
--- a/src/test/ui/asm/may_unwind.rs
+++ b/src/test/ui/asm/may_unwind.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
// run-pass
// needs-asm-support
diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr
index 1828066b6..f90967fbe 100644
--- a/src/test/ui/asm/naked-functions.stderr
+++ b/src/test/ui/asm/naked-functions.stderr
@@ -57,13 +57,11 @@ LL | a + 1
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:33:1
|
-LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
-LL | |
-LL | | a + 1
- | | ----- non-asm is unsupported in naked functions
-LL | |
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | a + 1
+ | ----- non-asm is unsupported in naked functions
error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:42:31
@@ -82,12 +80,11 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:48:1
|
-LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
-LL | |
-LL | | (|| a + 1)()
- | | ------------ non-asm is unsupported in naked functions
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | (|| a + 1)()
+ | ------------ non-asm is unsupported in naked functions
error[E0787]: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:65:10
@@ -124,30 +121,25 @@ LL | sym G, options(noreturn),
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:54:1
|
-LL | / pub unsafe extern "C" fn unsupported_operands() {
-LL | |
-LL | | let mut a = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut b = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut c = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut d = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut e = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-... |
-LL | | );
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn unsupported_operands() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | let mut a = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut b = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut c = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut d = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut e = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:77:1
|
-LL | / pub extern "C" fn missing_assembly() {
-LL | |
-LL | | }
- | |_^
+LL | pub extern "C" fn missing_assembly() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:84:5
@@ -185,20 +177,17 @@ LL | asm!("", options(noreturn));
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:82:1
|
-LL | / pub extern "C" fn too_many_asm_blocks() {
-LL | |
-LL | | asm!("");
-LL | |
-LL | | asm!("");
- | | -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | | asm!("");
- | | -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | | asm!("", options(noreturn));
- | | --------------------------- multiple asm blocks are unsupported in naked functions
-LL | | }
- | |_^
+LL | pub extern "C" fn too_many_asm_blocks() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | asm!("");
+ | -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL | asm!("");
+ | -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL | asm!("", options(noreturn));
+ | --------------------------- multiple asm blocks are unsupported in naked functions
error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:97:11
@@ -211,13 +200,11 @@ LL | *&y
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:95:5
|
-LL | / pub extern "C" fn inner(y: usize) -> usize {
-LL | |
-LL | | *&y
- | | --- non-asm is unsupported in naked functions
-LL | |
-LL | | }
- | |_____^
+LL | pub extern "C" fn inner(y: usize) -> usize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | *&y
+ | --- non-asm is unsupported in naked functions
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
--> $DIR/naked-functions.rs:105:5
@@ -249,18 +236,18 @@ LL | asm!("", options(noreturn, may_unwind));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: Rust ABI is unsupported in naked functions
- --> $DIR/naked-functions.rs:124:15
+ --> $DIR/naked-functions.rs:124:1
|
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:130:15
+ --> $DIR/naked-functions.rs:130:1
|
LL | pub unsafe fn rust_abi() {
- | ^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:170:1
diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr
index 162ff1d32..184513965 100644
--- a/src/test/ui/asm/type-check-1.stderr
+++ b/src/test/ui/asm/type-check-1.stderr
@@ -106,7 +106,7 @@ error[E0308]: mismatched types
--> $DIR/type-check-1.rs:60:26
|
LL | asm!("{}", const 0 as *mut u8);
- | ^^^^^^^^^^^^ expected integer, found *-ptr
+ | ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
@@ -133,7 +133,7 @@ error[E0308]: mismatched types
--> $DIR/type-check-1.rs:78:25
|
LL | global_asm!("{}", const 0 as *mut u8);
- | ^^^^^^^^^^^^ expected integer, found *-ptr
+ | ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
diff --git a/src/test/ui/asm/unpretty-expanded.rs b/src/test/ui/asm/unpretty-expanded.rs
new file mode 100644
index 000000000..6128f49b8
--- /dev/null
+++ b/src/test/ui/asm/unpretty-expanded.rs
@@ -0,0 +1,3 @@
+// check-pass
+// compile-flags: -Zunpretty=expanded
+core::arch::global_asm!("x: .byte 42");
diff --git a/src/test/ui/asm/unpretty-expanded.stdout b/src/test/ui/asm/unpretty-expanded.stdout
new file mode 100644
index 000000000..15b60d155
--- /dev/null
+++ b/src/test/ui/asm/unpretty-expanded.stdout
@@ -0,0 +1,9 @@
+#![feature(prelude_import)]
+#![no_std]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// check-pass
+// compile-flags: -Zunpretty=expanded
+global_asm! ("x: .byte 42");
diff --git a/src/test/ui/asm/x86_64/may_unwind.rs b/src/test/ui/asm/x86_64/may_unwind.rs
index 9844d63f0..2f5d1a360 100644
--- a/src/test/ui/asm/x86_64/may_unwind.rs
+++ b/src/test/ui/asm/x86_64/may_unwind.rs
@@ -1,7 +1,7 @@
-// min-llvm-version: 13.0.0
// only-x86_64
// run-pass
// needs-asm-support
+// needs-unwind
#![feature(asm_sym, asm_unwind)]
diff --git a/src/test/ui/asm/x86_64/sym.rs b/src/test/ui/asm/x86_64/sym.rs
index 622365bc7..447e11e6e 100644
--- a/src/test/ui/asm/x86_64/sym.rs
+++ b/src/test/ui/asm/x86_64/sym.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 12.0.1
// only-x86_64
// only-linux
// needs-asm-support
diff --git a/src/test/ui/asm/x86_64/type-check-3.stderr b/src/test/ui/asm/x86_64/type-check-3.stderr
index b38ea8cc4..366038fea 100644
--- a/src/test/ui/asm/x86_64/type-check-3.stderr
+++ b/src/test/ui/asm/x86_64/type-check-3.stderr
@@ -45,8 +45,8 @@ LL | asm!("{0} {0}", in(reg) 0i16);
| ^^^ ^^^ ---- for this argument
|
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `x` modifier to have the register formatted as `ax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
+ = help: use `{0:x}` to have the register formatted as `ax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:36:15
@@ -54,8 +54,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0:x}", in(reg) 0i16);
| ^^^ ---- for this argument
|
- = help: use the `x` modifier to have the register formatted as `ax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
+ = help: use `{0:x}` to have the register formatted as `ax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:38:15
@@ -63,8 +63,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0i32);
| ^^ ---- for this argument
|
- = 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`
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:41:15
@@ -72,8 +72,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(ymm_reg) 0i64);
| ^^ ---- for this argument
|
- = help: use the `x` modifier to have the register formatted as `xmm0`
- = help: or use the `y` modifier to keep the default formatting of `ymm0`
+ = help: use `{0:x}` to have the register formatted as `xmm0`
+ = help: or use `{0:y}` to keep the default formatting of `ymm0`
error: type `i8` cannot be used with this register class
--> $DIR/type-check-3.rs:52:28