diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2025-04-25 10:44:19 -0400 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2025-04-25 10:44:19 -0400 |
| commit | 3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab (patch) | |
| tree | 14a62b99cd2599a0e8abbab21158aecbf0d65962 /compiler/rustc_codegen_gcc/tests | |
| parent | 5c54aa781f97ae95ef01a3120650907b87d385d3 (diff) | |
| parent | 4f83a4258deb99f3288a7122c0d5a78200931c61 (diff) | |
| download | rust-3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab.tar.gz rust-3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab.zip | |
Merge commit '4f83a4258deb99f3288a7122c0d5a78200931c61' into subtree-update_cg_gcc_2025-04-25
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests')
| -rw-r--r-- | compiler/rustc_codegen_gcc/tests/lang_tests_common.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs b/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs index 64c932a2658..d5a0d71c4b2 100644 --- a/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs +++ b/compiler/rustc_codegen_gcc/tests/lang_tests_common.rs @@ -1,5 +1,7 @@ //! The common code for `tests/lang_tests_*.rs` +#![allow(clippy::uninlined_format_args)] + use std::env::{self, current_dir}; use std::path::{Path, PathBuf}; use std::process::Command; diff --git a/compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs b/compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs index c1254c51ce9..e627886a9d5 100644 --- a/compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs +++ b/compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs @@ -5,6 +5,7 @@ // stdout: 10 // 10 // 42 +// 1 #![feature(no_core)] #![no_std] @@ -21,6 +22,8 @@ fn int_cast(a: u16, b: i16) -> (u8, u16, u32, usize, i8, i16, i32, isize, u8, u3 ) } +static mut ONE: usize = 1; + #[no_mangle] extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 { let (a, b, c, d, e, f, g, h, i, j) = int_cast(10, 42); @@ -28,6 +31,10 @@ extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 { libc::printf(b"%d\n\0" as *const u8 as *const i8, c); libc::printf(b"%ld\n\0" as *const u8 as *const i8, d); libc::printf(b"%ld\n\0" as *const u8 as *const i8, j); + + let ptr = ONE as *mut usize; + let value = ptr as usize; + libc::printf(b"%ld\n\0" as *const u8 as *const i8, value); } 0 } |
