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