diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-05-21 19:45:35 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:39 +0100 |
commit | ae0ae911c43d47b94345a92d3dec348184ddae5a (patch) | |
tree | 06c771ec8cbc05c103b749dd281ae80b4d786627 /gcc | |
parent | 68a0a2cd79c88a9c1b243e69558b30c6af8ff918 (diff) | |
download | gcc-ae0ae911c43d47b94345a92d3dec348184ddae5a.zip gcc-ae0ae911c43d47b94345a92d3dec348184ddae5a.tar.gz gcc-ae0ae911c43d47b94345a92d3dec348184ddae5a.tar.bz2 |
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.
Diffstat (limited to 'gcc')
3 files changed, 30 insertions, 0 deletions
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 0000000..8d040ea --- /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 0000000..77af101 --- /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 0000000..ae3607f --- /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 |