diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-05-22 01:23:40 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:40 +0100 |
commit | 16e2b3e55957849ec919a7bcb89e816cc19ee6ff (patch) | |
tree | 52c1bd871c01565a27c04fa337aa5f194fec1a48 /gcc | |
parent | c02891fd841b6d1f17b806d3c5b0368c3dc159de (diff) | |
download | gcc-16e2b3e55957849ec919a7bcb89e816cc19ee6ff.zip gcc-16e2b3e55957849ec919a7bcb89e816cc19ee6ff.tar.gz gcc-16e2b3e55957849ec919a7bcb89e816cc19ee6ff.tar.bz2 |
gccrs: Wraps inline_asm tests in unsafe {}
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs:
Wraps inline_asm tests in unsafe {}
* rust/compile/inline_asm_faulty_clobber_1.rs: likewise.
* rust/compile/inline_asm_faulty_clobber_2.rs: likewise.
* rust/compile/inline_asm_ident_first.rs: likewise.
* rust/compile/inline_asm_nop.rs: likewise.
* rust/compile/inline_asm_nop_2.rs: likewise.
Diffstat (limited to 'gcc')
6 files changed, 18 insertions, 6 deletions
diff --git a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs index 8d040ea..67dc10b 100644 --- a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs +++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!("nop", clobber_abi()); // { dg-error "at least one abi must be provided as an argument to `clobber_abi`" } + unsafe { + 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 index 77af101..2906ea4 100644 --- a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs +++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!("nop", clobber_abi); // { dg-error "expected `\\(`, found end of macro arguments" } + unsafe { + 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 index ae3607f..e5bf1d1 100644 --- a/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs +++ b/gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!("nop", clobber_abi+); // { dg-error "expected `\\(`, found `\\+`" } + unsafe { + asm!("nop", clobber_abi+); // { dg-error "expected `\\(`, found `\\+`" } + } }
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/inline_asm_ident_first.rs b/gcc/testsuite/rust/compile/inline_asm_ident_first.rs index 9a4eb7e..a425b8e 100644 --- a/gcc/testsuite/rust/compile/inline_asm_ident_first.rs +++ b/gcc/testsuite/rust/compile/inline_asm_ident_first.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!(i_am_a_dummy); // { dg-error "asm template must be a string literal" } + unsafe { + asm!(i_am_a_dummy); // { dg-error "asm template must be a string literal" } + } }
\ No newline at end of file diff --git a/gcc/testsuite/rust/compile/inline_asm_nop.rs b/gcc/testsuite/rust/compile/inline_asm_nop.rs index ffe3161..7da9bef 100644 --- a/gcc/testsuite/rust/compile/inline_asm_nop.rs +++ b/gcc/testsuite/rust/compile/inline_asm_nop.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!("nop"); + unsafe { + asm!("nop"); + } } diff --git a/gcc/testsuite/rust/compile/inline_asm_nop_2.rs b/gcc/testsuite/rust/compile/inline_asm_nop_2.rs index 8437e8f..76f53fa 100644 --- a/gcc/testsuite/rust/compile/inline_asm_nop_2.rs +++ b/gcc/testsuite/rust/compile/inline_asm_nop_2.rs @@ -6,5 +6,7 @@ macro_rules! asm { } fn main() { - asm!("nop",); + unsafe { + asm!("nop",); + } } |