xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/array-construction.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | \
2*0a6a1f1dSLionel Sambuc // RUN: FileCheck %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -emit-llvm %s -o - | \
4*0a6a1f1dSLionel Sambuc // RUN: FileCheck %s
5f4a2713aSLionel Sambuc 
6f4a2713aSLionel Sambuc extern "C" int printf(...);
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc static int count;
9f4a2713aSLionel Sambuc static float fcount;
10f4a2713aSLionel Sambuc 
11f4a2713aSLionel Sambuc class xpto {
12f4a2713aSLionel Sambuc public:
xpto()13f4a2713aSLionel Sambuc   xpto() : i(count++), f(fcount++) {
14f4a2713aSLionel Sambuc     printf("xpto::xpto()\n");
15f4a2713aSLionel Sambuc   }
16f4a2713aSLionel Sambuc   int i;
17f4a2713aSLionel Sambuc   float f;
18f4a2713aSLionel Sambuc 
~xpto()19f4a2713aSLionel Sambuc   ~xpto() {
20f4a2713aSLionel Sambuc     printf("xpto::~xpto()\n");
21f4a2713aSLionel Sambuc   }
22f4a2713aSLionel Sambuc };
23f4a2713aSLionel Sambuc 
main()24f4a2713aSLionel Sambuc int main() {
25f4a2713aSLionel Sambuc   xpto array[2][3][4];
26f4a2713aSLionel Sambuc   for (int h = 0; h < 2; h++)
27f4a2713aSLionel Sambuc    for (int i = 0; i < 3; i++)
28f4a2713aSLionel Sambuc     for (int j = 0; j < 4; j++)
29f4a2713aSLionel Sambuc        printf("array[%d][%d][%d] = {%d, %f}\n",
30f4a2713aSLionel Sambuc               h, i, j, array[h][i][j].i, array[h][i][j].f);
31f4a2713aSLionel Sambuc }
32f4a2713aSLionel Sambuc 
33*0a6a1f1dSLionel Sambuc // CHECK: call void @_ZN4xptoC1Ev
34