Skip to content

Commit

Permalink
Add test case for using asm! outside of unsafe {}
Browse files Browse the repository at this point in the history
gcc/testsuite/ChangeLog:

	* rust/compile/inline_asm_outside_unsafe.rs: New test.
  • Loading branch information
badumbatish authored and CohenArthur committed Jun 24, 2024
1 parent 7d22e90 commit 2ce6c08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gcc/testsuite/rust/compile/inline_asm_outside_unsafe.rs
Original file line number Diff line number Diff line change
@@ -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" }
}

0 comments on commit 2ce6c08

Please sign in to comment.