os-rust/tests/assembly/breakpoint.rs
Josh Triplett a030ffbe35 Add core::arch::breakpoint and test
Approved in [ACP 491](https://github.com/rust-lang/libs-team/issues/491).

Remove the `unsafe` on `core::intrinsics::breakpoint()`, since it's a
safe intrinsic to call and has no prerequisites.

(Thanks to @zachs18 for figuring out the `bootstrap`/`not(bootstrap)`
logic.)
2024-12-02 23:56:24 -08:00

14 lines
272 B
Rust

//@ revisions: aarch64 x86_64
//@ assembly-output: emit-asm
//@[aarch64] only-aarch64
//@[x86_64] only-x86_64
#![feature(breakpoint)]
#![crate_type = "lib"]
// CHECK-LABEL: use_bp
// aarch64: brk #0xf000
// x86_64: int3
pub fn use_bp() {
core::arch::breakpoint();
}