about summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2023-07-13 00:54:11 -0400
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2023-07-13 00:54:11 -0400
commitecf2390fb0791f5f96507c11ed1f3b331f5e8b73 (patch)
tree4a075ec5917958fd14e50643d5aafc4e7dde38e3
parentc858d345b3028c7c1b66f36291baea9ce52cad5f (diff)
downloadrust-ecf2390fb0791f5f96507c11ed1f3b331f5e8b73.tar.gz
rust-ecf2390fb0791f5f96507c11ed1f3b331f5e8b73.zip
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.
-rw-r--r--tests/run-make/extern-fn-explicit-align/test.c4
-rw-r--r--tests/run-make/extern-fn-explicit-align/test.rs5
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/run-make/extern-fn-explicit-align/test.c b/tests/run-make/extern-fn-explicit-align/test.c
index 8d20864326b..a3db3442aaf 100644
--- a/tests/run-make/extern-fn-explicit-align/test.c
+++ b/tests/run-make/extern-fn-explicit-align/test.c
@@ -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;
 }
diff --git a/tests/run-make/extern-fn-explicit-align/test.rs b/tests/run-make/extern-fn-explicit-align/test.rs
index 56c6437dad2..ad06d92ac96 100644
--- a/tests/run-make/extern-fn-explicit-align/test.rs
+++ b/tests/run-make/extern-fn-explicit-align/test.rs
@@ -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(