diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-06-21 23:38:10 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:49 +0100 |
commit | 10ba2fdca79c949c3be8acaab73a2fe6ddccc57b (patch) | |
tree | 06142629b63163f04838b3d26799e0a860a5c904 /gcc | |
parent | 92418978e8a82f6ed86a86caf6fa37b4598a019e (diff) | |
download | gcc-10ba2fdca79c949c3be8acaab73a2fe6ddccc57b.zip gcc-10ba2fdca79c949c3be8acaab73a2fe6ddccc57b.tar.gz gcc-10ba2fdca79c949c3be8acaab73a2fe6ddccc57b.tar.bz2 |
gccrs: Add test case for using asm! outside of unsafe {}
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_outside_unsafe.rs: New test.
Diffstat (limited to 'gcc')
-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" } +} + |