extern fn-explicit-align test: don't use uint128_t
...which seems not to be available on some platforms. Or maybe it is under a different name but I don't want to deal with that Instead, use two u64s. This isn't exactly the same, but we already have some coverage of the packed u128 case in another test, so it's not essential to have it here.
This commit is contained in:
parent
c858d345b3
commit
ecf2390fb0
2 changed files with 6 additions and 3 deletions
|
@ -47,7 +47,8 @@ struct __attribute__((aligned(1))) LowerAlign
|
|||
#pragma pack(push, 1)
|
||||
struct Packed
|
||||
{
|
||||
__uint128_t a;
|
||||
uint64_t a;
|
||||
uint64_t b;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
@ -86,6 +87,7 @@ int32_t many_args(
|
|||
assert(l.b == 6);
|
||||
assert(!m);
|
||||
assert(n.a == 7);
|
||||
assert(n.b == 8);
|
||||
assert(strcmp(o, "Hello world") == 0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ pub struct LowerAlign {
|
|||
#[repr(C)]
|
||||
#[repr(packed)]
|
||||
pub struct Packed {
|
||||
pub a: u128
|
||||
pub a: u64,
|
||||
pub b: u64,
|
||||
}
|
||||
|
||||
#[link(name = "test", kind = "static")]
|
||||
|
@ -69,7 +70,7 @@ fn main() {
|
|||
let two_u64s = TwoU64s { a: 1, b: 2 };
|
||||
let wrapped = WrappedU64s { a: TwoU64s { a: 3, b: 4 } };
|
||||
let lower = LowerAlign { a: 5, b: 6 };
|
||||
let packed = Packed { a: 7 };
|
||||
let packed = Packed { a: 7, b: 8 };
|
||||
let string = STRING;
|
||||
unsafe {
|
||||
many_args(
|
||||
|
|
Loading…
Add table
Reference in a new issue