// #target: macos-x64

union Baz
{
    int x;
    double y;
}
struct Bar
{
    int x;
    int y;
}

struct Mega
{
    int[10] z;
}

fn int test()
{
    Mega m = {};
    int[1] azz = {};
    Bar b = {};
    Baz z = {};
    int[] sub = {};
    Bar[] foo = {};
    Baz[3] baz = {};
    return 1;
}

/* #expect: zero_init.ll

%Mega = type { [10 x i32] }
%Bar = type { i32, i32 }
%Baz = type { double }

define i32 @zero_init.test() #0 {
entry:
  %m = alloca %Mega, align 4
  %azz = alloca [1 x i32], align 4
  %b = alloca %Bar, align 4
  %z = alloca %Baz, align 8
  %sub = alloca %"int[]", align 8
  %foo = alloca %"Bar[]", align 8
  %baz = alloca [3 x %Baz], align 16
  call void @llvm.memset.p0.i64(ptr align 4 %m, i8 0, i64 40, i1 false)
  store i32 0, ptr %azz, align 4
  store i32 0, ptr %b, align 4
  %ptradd = getelementptr inbounds i8, ptr %b, i64 4
  store i32 0, ptr %ptradd, align 4
  call void @llvm.memset.p0.i64(ptr align 8 %z, i8 0, i64 8, i1 false)
  store %"int[]" zeroinitializer, ptr %sub, align 8
  store %"Bar[]" zeroinitializer, ptr %foo, align 8
  call void @llvm.memset.p0.i64(ptr align 16 %baz, i8 0, i64 24, i1 false)
  ret i32 1
}
