Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / constructor-for-array-members.cpp
blob8ea7eacd2b2bdad0a40d6e5b31660abeee3db368
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 i = 1234;
9 float vf = 1.00;
11 struct S {
12 S() : iS(i++), f1(vf++) {printf("S::S()\n");}
13 ~S(){printf("S::~S(iS = %d f1 = %f)\n", iS, f1); }
14 int iS;
15 float f1;
18 struct M {
19 double dM;
20 S ARR_S[3];
21 void pr() {
22 for (int i = 0; i < 3; i++)
23 printf("ARR_S[%d].iS = %d ARR_S[%d].f1 = %f\n", i, ARR_S[i].iS, i, ARR_S[i].f1);
25 for (int i = 0; i < 2; i++)
26 for (int j = 0; j < 3; j++)
27 for (int k = 0; k < 4; k++)
28 printf("MULTI_ARR[%d][%d][%d].iS = %d MULTI_ARR[%d][%d][%d].f1 = %f\n",
29 i,j,k, MULTI_ARR[i][j][k].iS, i,j,k, MULTI_ARR[i][j][k].f1);
33 S MULTI_ARR[2][3][4];
36 int main() {
37 M m1;
38 m1.pr();
41 // CHECK: call void @_ZN1SC1Ev