about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tests
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests')
-rw-r--r--compiler/rustc_codegen_gcc/tests/lang_tests_common.rs2
-rw-r--r--compiler/rustc_codegen_gcc/tests/run/ptr_cast.rs7
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
 }