blob: fac5cc01f6b72aaa97c4aa6a8718bd1514fce478 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O2 -o - | FileCheck %s
2static int count = 0;
3
4struct S {
5 S() { count++; }
6 ~S() { count--; }
7};
8
9struct P {
10 P() { count++; }
11 ~P() { count--; }
12};
13
14struct Q {
15 Q() { count++; }
16 ~Q() { count--; }
17};
18
19struct M : Q, P {
20 S s;
21 Q q;
22 P p;
23 P p_arr[3];
24 Q q_arr[2][3];
25};
26
27// CHECK: define i32 @_Z1fv() nounwind
28int f() {
29 {
30 count = 1;
31 M a;
32 }
33
34 // CHECK: ret i32 1
35 return count;
36}