From: jjasmine <tanghocle...@gmail.com>

gcc/testsuite/ChangeLog:

        * rust/compile/inline_asm_outside_unsafe.rs: New test.
---
 .../rust/compile/inline_asm_outside_unsafe.rs         | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs

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 00000000000..02b9ab0c393
--- /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" }
+}
+
-- 
2.45.2

Reply via email to