]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Wraps inline_asm tests in unsafe {}
authorjjasmine <tanghocle456@gmail.com>
Wed, 22 May 2024 08:23:40 +0000 (01:23 -0700)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:40 +0000 (16:35 +0100)
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.

gcc/testsuite/rust/compile/inline_asm_faulty_clobber.rs
gcc/testsuite/rust/compile/inline_asm_faulty_clobber_1.rs
gcc/testsuite/rust/compile/inline_asm_faulty_clobber_2.rs
gcc/testsuite/rust/compile/inline_asm_ident_first.rs
gcc/testsuite/rust/compile/inline_asm_nop.rs
gcc/testsuite/rust/compile/inline_asm_nop_2.rs

index 8d040ea40b4f6fc44b42cd2d55cfe79a6aaca757..67dc10bd75bc6aa70de3c1bcbe541ab24732a445 100644 (file)
@@ -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
index 77af10177c489d207dd6893ae3c6240676009b92..2906ea4292a5d46b200cfe0a58068481f94f4a37 100644 (file)
@@ -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
index ae3607ffa7781031da0278ce0ced37280fec396a..e5bf1d1f7f6233aab08deadf89b9398b0869cc5f 100644 (file)
@@ -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
index 9a4eb7ee402491bf728473e12cf5ee7d9f6a7410..a425b8e5ad4179830271b1de4f37330771c48b52 100644 (file)
@@ -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
index ffe3161cd73ce1efce33250791bb77e4b5998779..7da9bef3e568cf13f4d6ab1ffff521d949f88a34 100644 (file)
@@ -6,5 +6,7 @@ macro_rules! asm {
 }
 
 fn main() {
-    asm!("nop");
+    unsafe {
+        asm!("nop");
+    }
 }
index 8437e8fc66c30680e5a23986482195a210f9f64f..76f53fadbe3cf96d5fcc1e57d8c6f9e0fff0bb7a 100644 (file)
@@ -6,5 +6,7 @@ macro_rules! asm {
 }
 
 fn main() {
-    asm!("nop",);
+    unsafe {
+        asm!("nop",);
+    }
 }