]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix function name to printf
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 20 Mar 2025 16:26:55 +0000 (17:26 +0100)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Mon, 24 Mar 2025 11:13:57 +0000 (11:13 +0000)
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>
gcc/testsuite/rust/compile/feature_rust_attri0.rs
gcc/testsuite/rust/compile/nr2/exclude

index 9c11f561b5b65504d9a969dd141394828e1e56d6..1937acf3fe5fcc0e982d293ee7bdb29acd175b1b 100644 (file)
@@ -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
 }
index fed7bde630701c05a2051c552ecfdc6eb801f836..1582d5a2d969436631fa5d4b86013e8b5b8ac11d 100644 (file)
@@ -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