[gcc r15-8175] gccrs: Added faulty tests for inline asm cloberring
Arthur Cohen
cohenarthur@gcc.gnu.org
Mon Mar 17 15:44:01 GMT 2025
https://gcc.gnu.org/g:ae0ae911c43d47b94345a92d3dec348184ddae5a
commit r15-8175-gae0ae911c43d47b94345a92d3dec348184ddae5a
Author: jjasmine <tanghocle456@gmail.com>
Date: Tue May 21 19:45:35 2024 -0700
gccrs: Added faulty tests for inline asm cloberring
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs: New test.
* rust/compile/inline_asm_faulty_clobber_1.rs: New test.
* rust/compile/inline_asm_faulty_clobber_2.rs: New test.
Diff:
---
gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs | 10 ++++++++++
gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs | 10 ++++++++++
gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs | 10 ++++++++++
3 files changed, 30 insertions(+)
diff --git a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs
new file mode 100644
index 000000000000..8d040ea40b4f
--- /dev/null
+++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs
@@ -0,0 +1,10 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+ () => {}
+}
+
+fn main() {
+ asm!("nop", clobber_abi()); // { dg-error "at least one abi must be provided as an argument to `clobber_abi`" }
+}
\ No newline at end of file
diff --git a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs
new file mode 100644
index 000000000000..77af10177c48
--- /dev/null
+++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs
@@ -0,0 +1,10 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+ () => {}
+}
+
+fn main() {
+ asm!("nop", clobber_abi); // { dg-error "expected `\\(`, found end of macro arguments" }
+}
\ No newline at end of file
diff --git a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs
new file mode 100644
index 000000000000..ae3607ffa778
--- /dev/null
+++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs
@@ -0,0 +1,10 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+ () => {}
+}
+
+fn main() {
+ asm!("nop", clobber_abi+); // { dg-error "expected `\\(`, found `\\+`" }
+}
\ No newline at end of file
More information about the Gcc-cvs
mailing list