]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/return-non-c-like-enum-from-c/test.c
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / tests / run-make-fulldeps / return-non-c-like-enum-from-c / test.c
1 #include <stdint.h>
2
3 /* This is the code generated by cbindgen 0.12.1 for the `enum TT`
4  * type in nonclike.rs . */
5 enum TT_Tag {
6   AA,
7   BB,
8 };
9 typedef uint8_t TT_Tag;
10
11 typedef struct {
12   uint64_t _0;
13   uint64_t _1;
14 } AA_Body;
15
16 typedef struct {
17   TT_Tag tag;
18   union {
19     AA_Body aa;
20   };
21 } TT;
22
23 /* This is the code generated by cbindgen 0.12.1 for the `enum T` type
24  * in nonclike.rs . */
25 enum T_Tag {
26   A,
27   B,
28 };
29 typedef uint8_t T_Tag;
30
31 typedef struct {
32   uint64_t _0;
33 } A_Body;
34
35 typedef struct {
36   T_Tag tag;
37   union {
38     A_Body a;
39   };
40 } T;
41
42 TT tt_new(uint64_t a, uint64_t b) {
43   TT tt = {
44     .tag = AA,
45     .aa = {
46       ._0 = a,
47       ._1 = b,
48     },
49   };
50   return tt;
51 }
52
53 T t_new(uint64_t a) {
54   T t = {
55     .tag = A,
56     .a = {
57       ._0 = a,
58     },
59   };
60   return t;
61 }