diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/asm/aarch64/type-check-2.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/asm/aarch64/type-check-2.rs')
-rw-r--r-- | src/test/ui/asm/aarch64/type-check-2.rs | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/test/ui/asm/aarch64/type-check-2.rs b/src/test/ui/asm/aarch64/type-check-2.rs deleted file mode 100644 index 1c71c1185..000000000 --- a/src/test/ui/asm/aarch64/type-check-2.rs +++ /dev/null @@ -1,76 +0,0 @@ -// only-aarch64 - -#![feature(repr_simd, never_type)] - -use std::arch::{asm, global_asm}; - -#[repr(simd)] -#[derive(Clone, Copy)] -struct SimdType(f32, f32, f32, f32); - -#[repr(simd)] -struct SimdNonCopy(f32, f32, f32, f32); - -fn main() { - unsafe { - // Inputs must be initialized - - // Sym operands must point to a function or static - - const C: i32 = 0; - static S: i32 = 0; - asm!("{}", sym S); - asm!("{}", sym main); - asm!("{}", sym C); - //~^ ERROR invalid `sym` operand - - // Register operands must be Copy - - asm!("{:v}", in(vreg) SimdNonCopy(0.0, 0.0, 0.0, 0.0)); - //~^ ERROR arguments for inline assembly must be copyable - - // Register operands must be integers, floats, SIMD vectors, pointers or - // function pointers. - - asm!("{}", in(reg) 0i64); - asm!("{}", in(reg) 0f64); - asm!("{:v}", in(vreg) SimdType(0.0, 0.0, 0.0, 0.0)); - asm!("{}", in(reg) 0 as *const u8); - asm!("{}", in(reg) 0 as *mut u8); - asm!("{}", in(reg) main as fn()); - asm!("{}", in(reg) |x: i32| x); - //~^ ERROR cannot use value of type - asm!("{}", in(reg) vec![0]); - //~^ ERROR cannot use value of type `Vec<i32>` for inline assembly - asm!("{}", in(reg) (1, 2, 3)); - //~^ ERROR cannot use value of type `(i32, i32, i32)` for inline assembly - asm!("{}", in(reg) [1, 2, 3]); - //~^ ERROR cannot use value of type `[i32; 3]` for inline assembly - - // Register inputs (but not outputs) allow references and function types - - let mut f = main; - let mut r = &mut 0; - asm!("{}", in(reg) f); - asm!("{}", inout(reg) f); - //~^ ERROR cannot use value of type `fn() {main}` for inline assembly - asm!("{}", in(reg) r); - asm!("{}", inout(reg) r); - //~^ ERROR cannot use value of type `&mut i32` for inline assembly - let _ = (f, r); - - // Type checks ignore never type - - let u: ! = unreachable!(); - asm!("{}", in(reg) u); - } -} - -// Sym operands must point to a function or static - -const C: i32 = 0; -static S: i32 = 0; -global_asm!("{}", sym S); -global_asm!("{}", sym main); -global_asm!("{}", sym C); -//~^ ERROR invalid `sym` operand |