Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / array-operator-delete-call.cpp
blob890b142c10f84495d2b7ba4643044d65e32ee0e7
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | \
2 // RUN: FileCheck %s
3 // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -emit-llvm %s -o - | \
4 // RUN: FileCheck %s
6 extern "C" int printf(...);
8 int count;
10 struct S {
11 S() : iS (++count) { printf("S::S(%d)\n", iS); }
12 ~S() { printf("S::~S(%d)\n", iS); }
13 int iS;
16 struct V {
17 V() : iV (++count) { printf("V::V(%d)\n", iV); }
18 virtual ~V() { printf("V::~V(%d)\n", iV); }
19 int iV;
22 struct COST
24 S *cost;
25 V *vcost;
26 unsigned *cost_val;
28 ~COST();
29 COST();
33 COST::COST()
35 cost = new S[3];
36 vcost = new V[4];
37 cost_val = new unsigned[10];
40 COST::~COST()
42 if (cost) {
43 delete [] cost;
45 if (vcost) {
46 delete [] vcost;
48 if (cost_val)
49 delete [] cost_val;
52 COST c1;
54 int main()
56 COST c3;
58 COST c2;
60 // CHECK: call void @_ZdaPv