[gcc/devel/rust/master] Fix function name to printf
Thomas Schwinge
tschwinge@gcc.gnu.org
Wed Mar 26 14:19:30 GMT 2025
https://gcc.gnu.org/g:bb08a82b12a39a5ed2f7e178cfcf01081230b047
commit bb08a82b12a39a5ed2f7e178cfcf01081230b047
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Thu Mar 20 17:26:55 2025 +0100
Fix function name to printf
Function could not be found and triggered an error message.
gcc/testsuite/ChangeLog:
* rust/compile/feature_rust_attri0.rs: Add extern
function declaration and change name to printf.
* rust/compile/nr2/exclude: Remove now passing test from exclusion
list.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/testsuite/rust/compile/feature_rust_attri0.rs | 6 +++++-
gcc/testsuite/rust/compile/nr2/exclude | 1 -
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/rust/compile/feature_rust_attri0.rs b/gcc/testsuite/rust/compile/feature_rust_attri0.rs
index 9c11f561b5b6..1937acf3fe5f 100644
--- a/gcc/testsuite/rust/compile/feature_rust_attri0.rs
+++ b/gcc/testsuite/rust/compile/feature_rust_attri0.rs
@@ -1,3 +1,7 @@
+extern "C" {
+ fn printf(s: *const i8, ...);
+}
+
#[rustc_builtin_macro] //{ dg-error "internal implementation detail. " "" { target *-*-* } }
macro_rules! line {
() => {{}};
@@ -5,7 +9,7 @@ macro_rules! line {
fn main() -> i32 {
let a = line!();
- print(a);
+ printf("%d\0" as *const str as *const i8, a);
0
}
diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude
index fed7bde63070..1582d5a2d969 100644
--- a/gcc/testsuite/rust/compile/nr2/exclude
+++ b/gcc/testsuite/rust/compile/nr2/exclude
@@ -1,7 +1,6 @@
canonical_paths1.rs
cfg1.rs
const_generics_3.rs
-feature_rust_attri0.rs
generics9.rs
issue-1901.rs
issue-1981.rs
More information about the Gcc-cvs
mailing list