summaryrefslogtreecommitdiffstats
path: root/src/test/ui/asm/x86_64/type-check-5.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/asm/x86_64/type-check-5.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.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/x86_64/type-check-5.rs')
-rw-r--r--src/test/ui/asm/x86_64/type-check-5.rs63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/test/ui/asm/x86_64/type-check-5.rs b/src/test/ui/asm/x86_64/type-check-5.rs
deleted file mode 100644
index 8198df910..000000000
--- a/src/test/ui/asm/x86_64/type-check-5.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-// only-x86_64
-
-#![feature(repr_simd, never_type)]
-
-use std::arch::asm;
-
-#[repr(simd)]
-struct SimdNonCopy(f32, f32, f32, f32);
-
-fn main() {
- unsafe {
- // Inputs must be initialized
-
- let x: u64;
- asm!("{}", in(reg) x);
- //~^ ERROR E0381
- let mut y: u64;
- asm!("{}", inout(reg) y);
- //~^ ERROR E0381
- let _ = y;
-
- // Outputs require mutable places
-
- let v: Vec<u64> = vec![0, 1, 2];
- asm!("{}", in(reg) v[0]);
- asm!("{}", out(reg) v[0]);
- //~^ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
- asm!("{}", inout(reg) v[0]);
- //~^ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
-
- // Sym operands must point to a function or static
-
- const C: i32 = 0;
- static S: i32 = 0;
- asm!("{}", sym S);
- asm!("{}", sym main);
-
- // Register operands must be Copy
-
- // Register operands must be integers, floats, SIMD vectors, pointers or
- // function pointers.
-
- asm!("{}", in(reg) 0i64);
- asm!("{}", in(reg) 0f64);
- asm!("{}", in(xmm_reg) std::arch::x86_64::_mm_setzero_ps());
- asm!("{}", in(reg) 0 as *const u8);
- asm!("{}", in(reg) 0 as *mut u8);
- asm!("{}", in(reg) main as fn());
-
- // Register inputs (but not outputs) allow references and function types
-
- let mut f = main;
- let mut r = &mut 0;
- asm!("{}", in(reg) f);
- asm!("{}", in(reg) r);
- let _ = (f, r);
-
- // Type checks ignore never type
-
- let u: ! = unreachable!();
- asm!("{}", in(reg) u);
- }
-}