1 // RUN: clang-cc -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-cc -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 6 extern "C" int printf(...); 7 8 int count; 9 10 struct S { 11 S() : iS (++count) { printf("S::S(%d)\n", iS); } 12 ~S() { printf("S::~S(%d)\n", iS); } 13 int iS; 14 }; 15 16 struct COST 17 { 18 S *cost; 19 unsigned *cost_val; 20 21 ~COST(); 22 COST(); 23 }; 24 25 26 COST::COST() 27 { 28 cost = new S[3]; 29 cost_val = new unsigned[10]; 30 } 31 32 COST::~COST() 33 { 34 if (cost) { 35 delete [] cost; 36 } 37 if (cost_val) 38 delete [] cost_val; 39 } 40 41 COST c1; 42 43 int main() 44 { 45 COST c3; 46 } 47 COST c2; 48 49 // CHECK-LP64: call __ZdaPv 50 51 // CHECK-LP32: call L__ZdaPv 52 53