[COMMITTED 048/144] gccrs: Added new test for prep of output {}

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Mar 19 14:43:29 GMT 2025


From: badumbatish <tanghocle456@gmail.com>

gcc/testsuite/ChangeLog:

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

diff --git a/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs b/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs
new file mode 100644
index 00000000000..3134c73b3c2
--- /dev/null
+++ b/gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs
@@ -0,0 +1,18 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+    () => {};
+}
+
+fn main() {
+    let mut _num1: i32 = 10;
+    let mut _num2: i32 = 10;
+    unsafe {
+        asm!(
+            "mov {0}, 4",
+            out(reg) _num1,
+            out(reg) _num2,
+        );
+    }
+}
-- 
2.45.2



More information about the Gcc-rust mailing list