blob: 7b565a490c118014dd8c8d25fc167f82197d2c11 [file] [log] [blame]
Galina Kistanova0ccb31c2011-06-03 22:24:54 +00001// REQUIRES: x86-registered-target,x86-64-registered-target
Richard Smith762bb9d2011-10-13 22:29:44 +00002// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00003// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
Richard Smith762bb9d2011-10-13 22:29:44 +00004// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
Fariborz Jahanianae013b92009-10-28 20:55:41 +00006
7extern "C" int printf(...);
8
9static int count;
10static float fcount;
11
12class xpto {
13public:
14 xpto() : i(count++), f(fcount++) {
15 printf("xpto::xpto()\n");
16 }
17 int i;
18 float f;
19
Fariborz Jahanianae013b92009-10-28 20:55:41 +000020 ~xpto() {
21 printf("xpto::~xpto()\n");
22 }
Fariborz Jahanianae013b92009-10-28 20:55:41 +000023};
24
25int 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
Sean Callanan3b299012009-12-18 00:04:09 +000034// CHECK-LP64: callq __ZN4xptoC1Ev
Fariborz Jahanianae013b92009-10-28 20:55:41 +000035
Chris Lattner398e6b92010-09-22 06:09:31 +000036// CHECK-LP32: calll L__ZN4xptoC1Ev
Fariborz Jahanianae013b92009-10-28 20:55:41 +000037