]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Added new test for prep of output {}
authorbadumbatish <tanghocle456@gmail.com>
Sun, 21 Jul 2024 22:13:25 +0000 (15:13 -0700)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:06 +0000 (15:32 +0100)
gcc/testsuite/ChangeLog:

* rust/compile/inline_asm_parse_output_operand.rs: New test.

gcc/testsuite/rust/compile/inline_asm_parse_output_operand.rs [new file with mode: 0644]

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 (file)
index 0000000..3134c73
--- /dev/null
@@ -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,
+        );
+    }
+}