gccrs: Add test case for using asm! outside of unsafe {}

gcc/testsuite/ChangeLog:

	* rust/compile/inline_asm_outside_unsafe.rs: New test.
This commit is contained in:
jjasmine
2024-06-21 23:38:10 -07:00
committed by Arthur Cohen
parent 92418978e8
commit 10ba2fdca7

View File

@@ -0,0 +1,11 @@
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
macro_rules! asm {
() => {}
}
fn main() {
asm!("nop"); // { dg-error "use of inline assembly is unsafe and requires unsafe function or block" }
}