array-construction.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
2// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
3// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
4// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
5
6extern "C" int printf(...);
7
8static int count;
9static float fcount;
10
11class xpto {
12public:
13  xpto() : i(count++), f(fcount++) {
14    printf("xpto::xpto()\n");
15  }
16  int i;
17  float f;
18
19  ~xpto() {
20    printf("xpto::~xpto()\n");
21  }
22};
23
24int main() {
25  xpto array[2][3][4];
26  for (int h = 0; h < 2; h++)
27   for (int i = 0; i < 3; i++)
28    for (int j = 0; j < 4; j++)
29       printf("array[%d][%d][%d] = {%d, %f}\n",
30              h, i, j, array[h][i][j].i, array[h][i][j].f);
31}
32
33// CHECK-LP64: call     __ZN4xptoC1Ev
34
35// CHECK-LP32: call     L__ZN4xptoC1Ev
36
37