]> git.lizzy.rs Git - rust.git/blobdiff - src/test/auxiliary/rust_test_helpers.c
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01
[rust.git] / src / test / auxiliary / rust_test_helpers.c
index a5299638e52f80920cffb70e103b72d26585e765..92b7dd4b7c516bc388bec727585953b6989944ba 100644 (file)
@@ -168,6 +168,18 @@ struct floats {
     double c;
 };
 
+struct char_char_double {
+    uint8_t a;
+    uint8_t b;
+    double c;
+};
+
+struct char_char_float {
+    uint8_t a;
+    uint8_t b;
+    float c;
+};
+
 struct quad
 rust_dbg_abi_1(struct quad q) {
     struct quad qq = { q.c + 1,
@@ -185,6 +197,23 @@ rust_dbg_abi_2(struct floats f) {
     return ff;
 }
 
+struct char_char_double
+rust_dbg_abi_3(struct char_char_double a) {
+    struct char_char_double ccd = { a.a + 1,
+                                    a.b - 1,
+                                    a.c + 1.0 };
+    return ccd;
+}
+
+struct char_char_float
+rust_dbg_abi_4(struct char_char_float a) {
+    struct char_char_float ccd = { a.a + 1,
+                                   a.b - 1,
+                                   a.c + 1.0 };
+    return ccd;
+}
+
+
 int
 rust_dbg_static_mut = 3;
 
@@ -339,6 +368,7 @@ rust_dbg_unpack_option_u64(struct U8TaggedEnumOptionU64 o, uint64_t *into) {
         return 0;
     default:
         assert(0 && "unexpected tag");
+        return 0;
     }
 }
 
@@ -346,9 +376,9 @@ struct U8TaggedEnumOptionU64U64 {
     uint8_t tag;
     union {
         struct {
-           uint64_t a;
-           uint64_t b;
-       } some;
+            uint64_t a;
+            uint64_t b;
+        } some;
     };
 };
 
@@ -382,5 +412,6 @@ rust_dbg_unpack_option_u64u64(struct U8TaggedEnumOptionU64U64 o, uint64_t *a, ui
         return 0;
     default:
         assert(0 && "unexpected tag");
+        return 0;
     }
 }