.cargo/vendor/cbindgen/tests/expectations/asserted_cast.c
raw| 1 | #define MY_ASSERT(...) do { } while (0) |
| 2 | #define MY_ATTRS __attribute((noinline)) |
| 3 | |
| 4 | |
| 5 | #include <stdarg.h> |
| 6 | #include <stdbool.h> |
| 7 | #include <stdint.h> |
| 8 | #include <stdlib.h> |
| 9 | |
| 10 | typedef struct I I; |
| 11 | |
| 12 | enum H_Tag { |
| 13 | H_Foo, |
| 14 | H_Bar, |
| 15 | H_Baz, |
| 16 | }; |
| 17 | typedef uint8_t H_Tag; |
| 18 | |
| 19 | typedef struct { |
| 20 | uint8_t x; |
| 21 | int16_t y; |
| 22 | } H_Bar_Body; |
| 23 | |
| 24 | typedef struct { |
| 25 | H_Tag tag; |
| 26 | union { |
| 27 | struct { |
| 28 | int16_t foo; |
| 29 | }; |
| 30 | H_Bar_Body bar; |
| 31 | }; |
| 32 | } H; |
| 33 | |
| 34 | enum J_Tag { |
| 35 | J_Foo, |
| 36 | J_Bar, |
| 37 | J_Baz, |
| 38 | }; |
| 39 | typedef uint8_t J_Tag; |
| 40 | |
| 41 | typedef struct { |
| 42 | uint8_t x; |
| 43 | int16_t y; |
| 44 | } J_Bar_Body; |
| 45 | |
| 46 | typedef struct { |
| 47 | J_Tag tag; |
| 48 | union { |
| 49 | struct { |
| 50 | int16_t foo; |
| 51 | }; |
| 52 | J_Bar_Body bar; |
| 53 | }; |
| 54 | } J; |
| 55 | |
| 56 | enum K_Tag { |
| 57 | K_Foo, |
| 58 | K_Bar, |
| 59 | K_Baz, |
| 60 | }; |
| 61 | typedef uint8_t K_Tag; |
| 62 | |
| 63 | typedef struct { |
| 64 | K_Tag tag; |
| 65 | uint8_t x; |
| 66 | int16_t y; |
| 67 | } K_Bar_Body; |
| 68 | |
| 69 | typedef union { |
| 70 | K_Tag tag; |
| 71 | struct { |
| 72 | K_Tag foo_tag; |
| 73 | int16_t foo; |
| 74 | }; |
| 75 | K_Bar_Body bar; |
| 76 | } K; |
| 77 | |
| 78 | void foo(H h, I i, J j, K k); |