gcc/testsuite/g++.target/riscv/call-with-empty-struct.H
raw| 1 | #define MAKE_STRUCT_PASSING_TEST(type,val) \ |
| 2 | static struct struct_ ## type ## _t \ |
| 3 | { \ |
| 4 | struct { } e; \ |
| 5 | struct { type f; } s; \ |
| 6 | } global_struct_ ## type = { {}, { val } }; \ |
| 7 | \ |
| 8 | static bool \ |
| 9 | check_struct_ ## type (struct_ ## type ## _t obj) \ |
| 10 | { \ |
| 11 | return (obj.s.f == global_struct_ ## type .s.f); \ |
| 12 | } \ |
| 13 | \ |
| 14 | int \ |
| 15 | main () \ |
| 16 | { \ |
| 17 | bool result = check_struct_ ## type ( global_struct_ ## type ); \ |
| 18 | return result ? 0 : 1; \ |
| 19 | } |