Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/auxiliary/minicore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ impl_marker_trait!(

impl Sync for () {}

impl<T, const N: usize> Sync for [T; N] {}

#[lang = "drop_in_place"]
fn drop_in_place<T>(_: *mut T) {}

Expand Down
14 changes: 9 additions & 5 deletions tests/ui/asm/aarch64/aarch64-sve.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
//@ only-aarch64
//@ build-pass
//@ needs-asm-support

//@ add-minicore
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64
//@ ignore-backends: gcc
#![crate_type = "rlib"]
#![feature(no_core)]
#![no_core]

// AArch64 test corresponding to arm64ec-sve.rs.
extern crate minicore;
use minicore::*;

use std::arch::asm;
// AArch64 test corresponding to arm64ec-sve.rs.

fn f(x: f64) {
unsafe {
Expand Down
11 changes: 9 additions & 2 deletions tests/ui/asm/aarch64/bad-options.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
//@ only-aarch64
//@ add-minicore
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64
//@ ignore-backends: gcc
#![crate_type = "lib"]
#![feature(no_core)]
#![no_core]

use std::arch::{asm, global_asm};
extern crate minicore;
use minicore::*;

fn main() {
let mut foo = 0;
Expand Down
26 changes: 13 additions & 13 deletions tests/ui/asm/aarch64/bad-options.stderr
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
error: the `nomem` and `readonly` options are mutually exclusive
--> $DIR/bad-options.rs:8:18
--> $DIR/bad-options.rs:15:18
|
LL | asm!("", options(nomem, readonly));
| ^^^^^^^^^^^^^^^^^^^^^^^^

error: the `pure` and `noreturn` options are mutually exclusive
--> $DIR/bad-options.rs:10:18
--> $DIR/bad-options.rs:17:18
|
LL | asm!("", options(pure, nomem, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: asm with the `pure` option must have at least one output
--> $DIR/bad-options.rs:10:18
--> $DIR/bad-options.rs:17:18
|
LL | asm!("", options(pure, nomem, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: asm with the `pure` option must have at least one output
--> $DIR/bad-options.rs:13:33
--> $DIR/bad-options.rs:20:33
|
LL | asm!("{}", in(reg) foo, options(pure, nomem));
| ^^^^^^^^^^^^^^^^^^^^

error: asm outputs are not allowed with the `noreturn` option
--> $DIR/bad-options.rs:15:20
--> $DIR/bad-options.rs:22:20
|
LL | asm!("{}", out(reg) foo, options(noreturn));
| ^^^^^^^^^^^^

error: asm with `clobber_abi` must specify explicit registers for outputs
--> $DIR/bad-options.rs:22:20
--> $DIR/bad-options.rs:29:20
|
LL | asm!("{}", out(reg) foo, clobber_abi("C"));
| ^^^^^^^^^^^^ ---------------- clobber_abi
| |
| generic outputs

error: the `nomem` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:28:25
--> $DIR/bad-options.rs:35:25
|
LL | global_asm!("", options(nomem));
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: the `readonly` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:30:25
--> $DIR/bad-options.rs:37:25
|
LL | global_asm!("", options(readonly));
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: the `noreturn` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:32:25
--> $DIR/bad-options.rs:39:25
|
LL | global_asm!("", options(noreturn));
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly

error: the `pure` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:34:25
--> $DIR/bad-options.rs:41:25
|
LL | global_asm!("", options(pure));
| ^^^^ the `pure` option is not meaningful for global-scoped inline assembly

error: the `nostack` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:36:25
--> $DIR/bad-options.rs:43:25
|
LL | global_asm!("", options(nostack));
| ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly

error: the `preserves_flags` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:38:25
--> $DIR/bad-options.rs:45:25
|
LL | global_asm!("", options(preserves_flags));
| ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly

error: invalid ABI for `clobber_abi`
--> $DIR/bad-options.rs:20:18
--> $DIR/bad-options.rs:27:18
|
LL | asm!("", clobber_abi("foo"));
| ^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 3 additions & 2 deletions tests/ui/asm/aarch64/bad-reg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ add-minicore
//@ only-aarch64
//@ compile-flags: -C target-feature=+neon
//@ compile-flags: --target aarch64-unknown-linux-gnu -C target-feature=+neon
//@ needs-llvm-components: aarch64
//@ ignore-backends: gcc
#![crate_type = "lib"]
#![feature(no_core)]
#![no_core]
Expand Down
44 changes: 22 additions & 22 deletions tests/ui/asm/aarch64/bad-reg.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error: invalid register class `foo`: unknown register class
--> $DIR/bad-reg.rs:17:20
--> $DIR/bad-reg.rs:18:20
|
LL | asm!("{}", in(foo) foo);
| ^^^^^^^^^^^
|
= note: the following register classes are supported on this target: `reg`, `vreg`, `vreg_low16`, and `preg`

error: invalid register `foo`: unknown register
--> $DIR/bad-reg.rs:19:18
--> $DIR/bad-reg.rs:20:18
|
LL | asm!("", in("foo") foo);
| ^^^^^^^^^^^^^

error: invalid asm template modifier `z` for this register class
--> $DIR/bad-reg.rs:21:15
--> $DIR/bad-reg.rs:22:15
|
LL | asm!("{:z}", in(reg) foo);
| ^^^^ ----------- argument
Expand All @@ -23,7 +23,7 @@ LL | asm!("{:z}", in(reg) foo);
= note: the `reg` register class supports the following template modifiers: `w` and `x`

error: invalid asm template modifier `r` for this register class
--> $DIR/bad-reg.rs:23:15
--> $DIR/bad-reg.rs:24:15
|
LL | asm!("{:r}", in(vreg) foo);
| ^^^^ ------------ argument
Expand All @@ -33,7 +33,7 @@ LL | asm!("{:r}", in(vreg) foo);
= note: the `vreg` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, and `v`

error: invalid asm template modifier `r` for this register class
--> $DIR/bad-reg.rs:25:15
--> $DIR/bad-reg.rs:26:15
|
LL | asm!("{:r}", in(vreg_low16) foo);
| ^^^^ ------------------ argument
Expand All @@ -43,117 +43,117 @@ LL | asm!("{:r}", in(vreg_low16) foo);
= note: the `vreg_low16` register class supports the following template modifiers: `b`, `h`, `s`, `d`, `q`, and `v`

error: asm template modifiers are not allowed for `const` arguments
--> $DIR/bad-reg.rs:27:15
--> $DIR/bad-reg.rs:28:15
|
LL | asm!("{:a}", const 0);
| ^^^^ ------- argument
| |
| template modifier

error: asm template modifiers are not allowed for `sym` arguments
--> $DIR/bad-reg.rs:29:15
--> $DIR/bad-reg.rs:30:15
|
LL | asm!("{:a}", sym main);
| ^^^^ -------- argument
| |
| template modifier

error: invalid register `x29`: the frame pointer cannot be used as an operand for inline asm
--> $DIR/bad-reg.rs:31:18
--> $DIR/bad-reg.rs:32:18
|
LL | asm!("", in("x29") foo);
| ^^^^^^^^^^^^^

error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
--> $DIR/bad-reg.rs:33:18
--> $DIR/bad-reg.rs:34:18
|
LL | asm!("", in("sp") foo);
| ^^^^^^^^^^^^

error: invalid register `xzr`: the zero register cannot be used as an operand for inline asm
--> $DIR/bad-reg.rs:35:18
--> $DIR/bad-reg.rs:36:18
|
LL | asm!("", in("xzr") foo);
| ^^^^^^^^^^^^^

error: invalid register `x19`: x19 is used internally by LLVM and cannot be used as an operand for inline asm
--> $DIR/bad-reg.rs:37:18
--> $DIR/bad-reg.rs:38:18
|
LL | asm!("", in("x19") foo);
| ^^^^^^^^^^^^^

error: register class `preg` can only be used as a clobber, not as an input or output
--> $DIR/bad-reg.rs:40:18
--> $DIR/bad-reg.rs:41:18
|
LL | asm!("", in("p0") foo);
| ^^^^^^^^^^^^

error: register class `preg` can only be used as a clobber, not as an input or output
--> $DIR/bad-reg.rs:44:20
--> $DIR/bad-reg.rs:45:20
|
LL | asm!("{}", in(preg) foo);
| ^^^^^^^^^^^^

error: register class `preg` can only be used as a clobber, not as an input or output
--> $DIR/bad-reg.rs:47:20
--> $DIR/bad-reg.rs:48:20
|
LL | asm!("{}", out(preg) _);
| ^^^^^^^^^^^

error: register `w0` conflicts with register `x0`
--> $DIR/bad-reg.rs:53:32
--> $DIR/bad-reg.rs:54:32
|
LL | asm!("", in("x0") foo, in("w0") bar);
| ------------ ^^^^^^^^^^^^ register `w0`
| |
| register `x0`

error: register `x0` conflicts with register `x0`
--> $DIR/bad-reg.rs:55:32
--> $DIR/bad-reg.rs:56:32
|
LL | asm!("", in("x0") foo, out("x0") bar);
| ------------ ^^^^^^^^^^^^^ register `x0`
| |
| register `x0`
|
help: use `lateout` instead of `out` to avoid conflict
--> $DIR/bad-reg.rs:55:18
--> $DIR/bad-reg.rs:56:18
|
LL | asm!("", in("x0") foo, out("x0") bar);
| ^^^^^^^^^^^^

error: register `q0` conflicts with register `v0`
--> $DIR/bad-reg.rs:58:32
--> $DIR/bad-reg.rs:59:32
|
LL | asm!("", in("v0") foo, in("q0") bar);
| ------------ ^^^^^^^^^^^^ register `q0`
| |
| register `v0`

error: register `q0` conflicts with register `v0`
--> $DIR/bad-reg.rs:60:32
--> $DIR/bad-reg.rs:61:32
|
LL | asm!("", in("v0") foo, out("q0") bar);
| ------------ ^^^^^^^^^^^^^ register `q0`
| |
| register `v0`
|
help: use `lateout` instead of `out` to avoid conflict
--> $DIR/bad-reg.rs:60:18
--> $DIR/bad-reg.rs:61:18
|
LL | asm!("", in("v0") foo, out("q0") bar);
| ^^^^^^^^^^^^

error: type `i32` cannot be used with this register class
--> $DIR/bad-reg.rs:40:27
--> $DIR/bad-reg.rs:41:27
|
LL | asm!("", in("p0") foo);
| ^^^
|
= note: register class `preg` supports these types:

error: type `i32` cannot be used with this register class
--> $DIR/bad-reg.rs:44:29
--> $DIR/bad-reg.rs:45:29
|
LL | asm!("{}", in(preg) foo);
| ^^^
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/asm/aarch64/duplicate-options.fixed
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
//@ only-aarch64
//@ needs-asm-support
//@ run-rustfix
//@ add-minicore
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64
//@ needs-asm-support
//@ ignore-backends: gcc
#![feature(no_core)]
#![no_core]

use std::arch::asm;
extern crate minicore;
use minicore::*;

fn main() {
unsafe {
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/asm/aarch64/duplicate-options.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
//@ only-aarch64
//@ needs-asm-support
//@ run-rustfix
//@ add-minicore
//@ compile-flags: --target aarch64-unknown-linux-gnu
//@ needs-llvm-components: aarch64
//@ needs-asm-support
//@ ignore-backends: gcc
#![feature(no_core)]
#![no_core]

use std::arch::asm;
extern crate minicore;
use minicore::*;

fn main() {
unsafe {
Expand Down
Loading
Loading