diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2024-09-05 19:45:40 +0200 | 
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-10-06 19:00:09 +0200 | 
| commit | 5fc60d1e52ea12f53d2c8d22fee94592860739ad (patch) | |
| tree | 084c2db049438541f8365fbb25fe4fa6123c2436 /compiler/rustc_codegen_cranelift/example | |
| parent | 10fa482906ab1f2fba07b32b70457ad9444e8f63 (diff) | |
| download | rust-5fc60d1e52ea12f53d2c8d22fee94592860739ad.tar.gz rust-5fc60d1e52ea12f53d2c8d22fee94592860739ad.zip | |
various fixes for `naked_asm!` implementation
- fix for divergence - fix error message - fix another cranelift test - fix some cranelift things - don't set the NORETURN option for naked asm - fix use of naked_asm! in doc comment - fix use of naked_asm! in run-make test - use `span_bug` in unreachable branch
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/mini_core.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs | 2 | 
2 files changed, 7 insertions, 1 deletions
| diff --git a/compiler/rustc_codegen_cranelift/example/mini_core.rs b/compiler/rustc_codegen_cranelift/example/mini_core.rs index 5e535ff62e1..9fc0318df5d 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core.rs @@ -726,6 +726,12 @@ pub macro global_asm() { /* compiler built-in */ } +#[rustc_builtin_macro] +#[rustc_macro_transparency = "semitransparent"] +pub macro naked_asm() { + /* compiler built-in */ +} + pub static A_STATIC: u8 = 42; #[lang = "panic_location"] diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index ccbd5a78485..e47431e0f87 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -390,7 +390,7 @@ global_asm! { #[naked] extern "C" fn naked_test() { unsafe { - asm!("ret", options(noreturn)); + naked_asm!("ret"); } } | 
