xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/variable-array.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm < %s | grep puts | count 4
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // PR3248
a(int x)4*f4a2713aSLionel Sambuc int a(int x)
5*f4a2713aSLionel Sambuc {
6*f4a2713aSLionel Sambuc   int (*y)[x];
7*f4a2713aSLionel Sambuc   return sizeof(*(puts("asdf"),y));
8*f4a2713aSLionel Sambuc }
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // PR3247
b()11*f4a2713aSLionel Sambuc int b() {
12*f4a2713aSLionel Sambuc   return sizeof(*(char(*)[puts("asdf")])0);
13*f4a2713aSLionel Sambuc }
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc // PR3247
c()16*f4a2713aSLionel Sambuc int c() {
17*f4a2713aSLionel Sambuc   static int (*y)[puts("asdf")];
18*f4a2713aSLionel Sambuc   return sizeof(*y);
19*f4a2713aSLionel Sambuc }
20