xref: /llvm-project/clang/test/CodeGen/2002-03-12-ArrayInitialization.c (revision 85e5156598b1bbad0ae41cf4d0d5b845dd655ffd)
1*85e51565SEric Christopher // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
2*85e51565SEric Christopher 
3*85e51565SEric Christopher /* GCC would generate bad code if not enough initializers are
4*85e51565SEric Christopher    specified for an array.
5*85e51565SEric Christopher  */
6*85e51565SEric Christopher 
7*85e51565SEric Christopher int a[10] = { 0, 2};
8*85e51565SEric Christopher 
9*85e51565SEric Christopher char str[10] = "x";
10*85e51565SEric Christopher 
11*85e51565SEric Christopher void *Arr[5] = { 0, 0 };
12*85e51565SEric Christopher 
13*85e51565SEric Christopher float F[12] = { 1.23f, 34.7f };
14*85e51565SEric Christopher 
15*85e51565SEric Christopher struct Test { int X; double Y; };
16*85e51565SEric Christopher 
17*85e51565SEric Christopher struct Test Array[10] = { { 2, 12.0 }, { 3, 24.0 } };
18*85e51565SEric Christopher 
19*85e51565SEric Christopher int B[4][4] = { { 1, 2, 3, 4}, { 5, 6, 7 }, { 8, 9 } };
20