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