about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2024-11-02 21:06:46 +0800
committerJieyou Xu <jieyouxu@outlook.com>2024-11-02 21:59:27 +0800
commit89a107740c43901acdce6f6f8167bfecd4ec7ae6 (patch)
tree480a6658e7839064087e5b2746d338a71a2ec138
parente97ba538795c89837bf6abc998e694f495e4423c (diff)
downloadrust-89a107740c43901acdce6f6f8167bfecd4ec7ae6.tar.gz
rust-89a107740c43901acdce6f6f8167bfecd4ec7ae6.zip
Add more core stubs to `minicore`
`f32`, `f64` and `asm!` macro.
-rw-r--r--tests/auxiliary/minicore.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs
index 49a7580eccc..9d9506b8e91 100644
--- a/tests/auxiliary/minicore.rs
+++ b/tests/auxiliary/minicore.rs
@@ -6,6 +6,7 @@
 //!
 //! - `minicore` is **only** intended for `core` items, and the stubs should match the actual `core`
 //!   items.
+//! - Becareful of adding new features and things that are only available for a subset of targets.
 //!
 //! # References
 //!
@@ -13,8 +14,9 @@
 //! <https://github.com/rust-lang/rust/blob/c0b5cc9003f6464c11ae1c0662c6a7e06f6f5cab/compiler/rustc_codegen_cranelift/example/mini_core.rs>.
 // ignore-tidy-linelength
 
-#![feature(no_core, lang_items, rustc_attrs)]
+#![feature(no_core, lang_items, rustc_attrs, decl_macro)]
 #![allow(unused, improper_ctypes_definitions, internal_features)]
+#![feature(asm_experimental_arch)]
 #![no_std]
 #![no_core]
 
@@ -37,7 +39,9 @@ impl<T: ?Sized> LegacyReceiver for &mut T {}
 #[lang = "copy"]
 pub trait Copy: Sized {}
 
-impl_marker_trait!(Copy => [ bool, char, isize, usize, i8, i16, i32, i64, u8, u16, u32, u64 ]);
+impl_marker_trait!(
+    Copy => [ bool, char, isize, usize, i8, i16, i32, i64, u8, u16, u32, u64, f32, f64 ]
+);
 impl<'a, T: ?Sized> Copy for &'a T {}
 impl<T: ?Sized> Copy for *const T {}
 impl<T: ?Sized> Copy for *mut T {}
@@ -70,3 +74,8 @@ impl<T: Copy + ?Sized> Copy for ManuallyDrop<T> {}
 pub struct UnsafeCell<T: ?Sized> {
     value: T,
 }
+
+#[rustc_builtin_macro]
+pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
+    /* compiler built-in */
+}