diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-05-21 19:45:35 -0700 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-06-13 15:31:07 +0000 |
commit | de7dbe64f859ab67ee0160cff6f8463569dd9739 (patch) | |
tree | ffbe7351fb5572d39e8e2ce1c27340576ef3a042 /gcc | |
parent | a4fe2a1016a8ebfd0d7a3b139f50b7b4fa258e6c (diff) | |
download | gcc-de7dbe64f859ab67ee0160cff6f8463569dd9739.zip gcc-de7dbe64f859ab67ee0160cff6f8463569dd9739.tar.gz gcc-de7dbe64f859ab67ee0160cff6f8463569dd9739.tar.bz2 |
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 |