diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-08-14 21:43:07 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-14 21:43:07 +0800 |
| commit | 5ea1a177bf83c3bf9bb69257a4c107f9c17e6105 (patch) | |
| tree | 787c8dd1e4f4690c3c901fab2c0b2bd6cf42336e | |
| parent | 1bdeb98734d47eaca9fb2dbfa712d14487fe7b1e (diff) | |
| parent | bf5d862220b9a0fd04e326e935deb27bb5c6f9f3 (diff) | |
| download | rust-5ea1a177bf83c3bf9bb69257a4c107f9c17e6105.tar.gz rust-5ea1a177bf83c3bf9bb69257a4c107f9c17e6105.zip | |
Rollup merge of #128570 - folkertdev:stabilize-asm-const, r=Amanieu
Stabilize `asm_const` tracking issue: https://github.com/rust-lang/rust/issues/93332 reference PR: https://github.com/rust-lang/reference/pull/1556 this will probably require some CI wrangling (and a rebase), so let's get that over with even though the final required PR is not merged yet. r? `@ghost`
| -rw-r--r-- | tests/run/asm.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/run/asm.rs b/tests/run/asm.rs index 56f2aac3d0a..4e05d026868 100644 --- a/tests/run/asm.rs +++ b/tests/run/asm.rs @@ -3,12 +3,10 @@ // Run-time: // status: 0 -#![feature(asm_const)] - -#[cfg(target_arch="x86_64")] +#[cfg(target_arch = "x86_64")] use std::arch::{asm, global_asm}; -#[cfg(target_arch="x86_64")] +#[cfg(target_arch = "x86_64")] global_asm!( " .global add_asm @@ -22,7 +20,7 @@ extern "C" { fn add_asm(a: i64, b: i64) -> i64; } -#[cfg(target_arch="x86_64")] +#[cfg(target_arch = "x86_64")] pub unsafe fn mem_cpy(dst: *mut u8, src: *const u8, len: usize) { asm!( "rep movsb", @@ -33,7 +31,7 @@ pub unsafe fn mem_cpy(dst: *mut u8, src: *const u8, len: usize) { ); } -#[cfg(target_arch="x86_64")] +#[cfg(target_arch = "x86_64")] fn asm() { unsafe { asm!("nop"); @@ -178,9 +176,8 @@ fn asm() { assert_eq!(array1, array2); } -#[cfg(not(target_arch="x86_64"))] -fn asm() { -} +#[cfg(not(target_arch = "x86_64"))] +fn asm() {} fn main() { asm(); |
