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