// #target: macos-x64

module foo;

struct Bar {
  int a;
}

Bar[6] bar;

fn int main()
{
    test_bar(0);
    return 0;
}

fn void test_bar(int idx)
{
    bar[idx].a = 0;
    bar[0].a = idx;
}

/* #expect: foo.ll

define void @foo.test_bar(i32 %0) #0 {
entry:
  %sext = sext i32 %0 to i64
  %ptroffset = getelementptr inbounds [4 x i8], ptr @foo.bar, i64 %sext
  store i32 0, ptr %ptroffset, align 4
  store i32 %0, ptr @foo.bar, align 16
  ret void
}
