Skip to content

Commit ecf2390

Browse files
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.
1 parent c858d34 commit ecf2390

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/run-make/extern-fn-explicit-align/test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ struct __attribute__((aligned(1))) LowerAlign
4747
#pragma pack(push, 1)
4848
struct Packed
4949
{
50-
__uint128_t a;
50+
uint64_t a;
51+
uint64_t b;
5152
};
5253
#pragma pack(pop)
5354

@@ -86,6 +87,7 @@ int32_t many_args(
8687
assert(l.b == 6);
8788
assert(!m);
8889
assert(n.a == 7);
90+
assert(n.b == 8);
8991
assert(strcmp(o, "Hello world") == 0);
9092
return 0;
9193
}

tests/run-make/extern-fn-explicit-align/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ pub struct LowerAlign {
3838
#[repr(C)]
3939
#[repr(packed)]
4040
pub struct Packed {
41-
pub a: u128
41+
pub a: u64,
42+
pub b: u64,
4243
}
4344

4445
#[link(name = "test", kind = "static")]
@@ -69,7 +70,7 @@ fn main() {
6970
let two_u64s = TwoU64s { a: 1, b: 2 };
7071
let wrapped = WrappedU64s { a: TwoU64s { a: 3, b: 4 } };
7172
let lower = LowerAlign { a: 5, b: 6 };
72-
let packed = Packed { a: 7 };
73+
let packed = Packed { a: 7, b: 8 };
7374
let string = STRING;
7475
unsafe {
7576
many_args(

0 commit comments

Comments
 (0)