aboutsummaryrefslogtreecommitdiff
path: root/test/cases/translate_c/zero_width_field_alignment.c
blob: c50bb668fd624f8d5a63ee35d03c10d9986713b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct __attribute__((packed)) foo {
  int x;
  struct {};
  float y;
  union {};
};

// translate-c
// c_frontend=aro
//
// const struct_unnamed_1 = extern struct {};
// const union_unnamed_2 = extern union {};
// pub const struct_foo = extern struct {
//     x: c_int align(1) = @import("std").mem.zeroes(c_int),
//     unnamed_0: struct_unnamed_1 align(1) = @import("std").mem.zeroes(struct_unnamed_1),
//     y: f32 align(1) = @import("std").mem.zeroes(f32),
//     unnamed_1: union_unnamed_2 align(1) = @import("std").mem.zeroes(union_unnamed_2),
// };