about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tests/run/packed_u128.rs
blob: b7cc6e2102362ea6e671156ad1ba11e109bdbfae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
}