xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/global-with-initialiser.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o %t
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc const int globalInt = 1;
4*f4a2713aSLionel Sambuc int globalIntWithFloat = 1.5f;
5*f4a2713aSLionel Sambuc int globalIntArray[5] = { 1, 2 };
6*f4a2713aSLionel Sambuc int globalIntFromSizeOf = sizeof(globalIntArray);
7*f4a2713aSLionel Sambuc char globalChar = 'a';
8*f4a2713aSLionel Sambuc char globalCharArray[5] = { 'a', 'b' };
9*f4a2713aSLionel Sambuc float globalFloat = 1.0f;
10*f4a2713aSLionel Sambuc float globalFloatWithInt = 1;
11*f4a2713aSLionel Sambuc float globalFloatArray[5] = { 1.0f, 2.0f };
12*f4a2713aSLionel Sambuc double globalDouble = 1.0;
13*f4a2713aSLionel Sambuc double globalDoubleArray[5] = { 1.0, 2.0 };
14*f4a2713aSLionel Sambuc char *globalString = "abc";
15*f4a2713aSLionel Sambuc char *globalStringArray[5] = { "123", "abc" };
16*f4a2713aSLionel Sambuc long double globalLongDouble = 1;
17*f4a2713aSLionel Sambuc long double globalLongDoubleArray[5] = { 1.0, 2.0 };
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc struct Struct {
20*f4a2713aSLionel Sambuc   int member1;
21*f4a2713aSLionel Sambuc   float member2;
22*f4a2713aSLionel Sambuc   char *member3;
23*f4a2713aSLionel Sambuc };
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc struct Struct globalStruct = { 1, 2.0f, "foobar"};
26