xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2002-03-12-StructInitializer.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc /* GCC was not emitting string constants of the correct length when
4*f4a2713aSLionel Sambuc  * embedded into a structure field like this.  It thought the strlength
5*f4a2713aSLionel Sambuc  * was -1.
6*f4a2713aSLionel Sambuc  */
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc typedef struct Connection_Type {
9*f4a2713aSLionel Sambuc    long    to;
10*f4a2713aSLionel Sambuc    char    type[10];
11*f4a2713aSLionel Sambuc    long    length;
12*f4a2713aSLionel Sambuc } Connection;
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc Connection link[3]
15*f4a2713aSLionel Sambuc = { {1, "link1", 10},
16*f4a2713aSLionel Sambuc     {2, "link2", 20},
17*f4a2713aSLionel Sambuc     {3, "link3", 30} };
18*f4a2713aSLionel Sambuc 
19