diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-06-21 23:38:10 -0700 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-06-24 13:16:02 +0000 |
commit | 2ce6c08f21a756c513b7ea7cb22a3c0067665790 (patch) | |
tree | 5bf61f595cba1c230294a76f7df339c63bbdc566 | |
parent | 7d22e900b069c5acdff8272da89b959c50dcb666 (diff) | |
download | gcc-2ce6c08f21a756c513b7ea7cb22a3c0067665790.zip gcc-2ce6c08f21a756c513b7ea7cb22a3c0067665790.tar.gz gcc-2ce6c08f21a756c513b7ea7cb22a3c0067665790.tar.bz2 |
Add test case for using asm! outside of unsafe {}
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_outside_unsafe.rs: New test.
-rw-r--r-- | gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs b/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs new file mode 100644 index 0000000..02b9ab0 --- /dev/null +++ b/gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs @@ -0,0 +1,11 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {} +} + +fn main() { + asm!("nop"); // { dg-error "use of inline assembly is unsafe and requires unsafe function or block" } +} + |