about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tests/run/packed_u128.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-18 15:11:44 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-18 15:11:44 +0200
commitc48d8d4d800df8a59d412c5c4299c8fadcd039e9 (patch)
treecba780e8e9940952265aa1587419e557994e3423 /compiler/rustc_codegen_gcc/tests/run/packed_u128.rs
parent6f935a044d1ddeb6160494a6320d008d7c311aef (diff)
parentfda0bb9588912a3e0606e880ca9f6e913cf8a5a4 (diff)
downloadrust-c48d8d4d800df8a59d412c5c4299c8fadcd039e9.tar.gz
rust-c48d8d4d800df8a59d412c5c4299c8fadcd039e9.zip
Merge commit 'fda0bb9588912a3e0606e880ca9f6e913cf8a5a4' into subtree-update_cg_gcc_2025-06-18
Diffstat (limited to 'compiler/rustc_codegen_gcc/tests/run/packed_u128.rs')
-rw-r--r--compiler/rustc_codegen_gcc/tests/run/packed_u128.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/tests/run/packed_u128.rs b/compiler/rustc_codegen_gcc/tests/run/packed_u128.rs
new file mode 100644
index 00000000000..b7cc6e21023
--- /dev/null
+++ b/compiler/rustc_codegen_gcc/tests/run/packed_u128.rs
@@ -0,0 +1,31 @@
+// Compiler:
+//
+// Run-time:
+//   status: 0
+
+#![feature(no_core)]
+#![no_std]
+#![no_core]
+#![no_main]
+
+extern crate mini_core;
+use intrinsics::black_box;
+use mini_core::*;
+#[repr(packed(1))]
+pub struct ScalarInt {
+    data: u128,
+    size: u8,
+}
+#[inline(never)]
+#[no_mangle]
+fn read_data(a: &ScalarInt) {
+    black_box(a.data);
+}
+
+#[no_mangle]
+extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
+    let data =
+        [black_box(ScalarInt { data: 0, size: 1 }), black_box(ScalarInt { data: 0, size: 1 })];
+    read_data(&data[1]);
+    0
+}