mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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:
11
gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs
Normal file
11
gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs
Normal 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" }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user