xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2009-03-08-ZeroEltStructCrash.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o -
2*f4a2713aSLionel Sambuc // PR3744
3*f4a2713aSLionel Sambuc struct Empty {};
4*f4a2713aSLionel Sambuc struct Union {
5*f4a2713aSLionel Sambuc  union {
6*f4a2713aSLionel Sambuc    int zero_arr[0];
7*f4a2713aSLionel Sambuc  } contents;
8*f4a2713aSLionel Sambuc };
Foo(struct Union * u)9*f4a2713aSLionel Sambuc static inline void Foo(struct Union *u) {
10*f4a2713aSLionel Sambuc  int *array = u->contents.zero_arr;
11*f4a2713aSLionel Sambuc }
Bar(struct Union * u)12*f4a2713aSLionel Sambuc static void Bar(struct Union *u) {
13*f4a2713aSLionel Sambuc  Foo(u);
14*f4a2713aSLionel Sambuc }
15