diff --git a/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs b/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs new file mode 100644 index 000000000000..02b9ab0c393e --- /dev/null +++ b/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs @@ -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" } +} +