diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-08-10 18:13:03 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-08-13 23:18:31 +0200 |
| commit | 8419c0956e1cee2799984b7b9520a0118ec0cb9c (patch) | |
| tree | 31473731656d4e0b3ff870d186d52f950368dbe4 /compiler/rustc_codegen_gcc/tests/run/asm.rs | |
| parent | 80eb5a8e910e5185d47cdefe3732d839c78a5e7e (diff) | |
| download | rust-8419c0956e1cee2799984b7b9520a0118ec0cb9c.tar.gz rust-8419c0956e1cee2799984b7b9520a0118ec0cb9c.zip | |
stabilize `asm_const`
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests/run/asm.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/tests/run/asm.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_gcc/tests/run/asm.rs b/compiler/rustc_codegen_gcc/tests/run/asm.rs index 56f2aac3d0a..4e05d026868 100644 --- a/compiler/rustc_codegen_gcc/tests/run/asm.rs +++ b/compiler/rustc_codegen_gcc/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(); |
