2010-01-27 11:03:08 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O2 -o - | FileCheck %s
|
|
|
|
static int count = 0;
|
2009-08-21 07:33:31 +08:00
|
|
|
|
2009-08-18 03:04:50 +08:00
|
|
|
struct S {
|
2010-01-27 11:03:08 +08:00
|
|
|
S() { count++; }
|
|
|
|
~S() { count--; }
|
2009-08-18 03:04:50 +08:00
|
|
|
};
|
|
|
|
|
2010-01-27 11:03:08 +08:00
|
|
|
struct P {
|
|
|
|
P() { count++; }
|
|
|
|
~P() { count--; }
|
2009-08-18 03:04:50 +08:00
|
|
|
};
|
|
|
|
|
2010-01-27 11:03:08 +08:00
|
|
|
struct Q {
|
|
|
|
Q() { count++; }
|
|
|
|
~Q() { count--; }
|
2009-08-18 03:04:50 +08:00
|
|
|
};
|
|
|
|
|
2010-01-27 11:03:08 +08:00
|
|
|
struct M : Q, P {
|
2009-08-18 03:04:50 +08:00
|
|
|
S s;
|
|
|
|
Q q;
|
2010-01-27 11:03:08 +08:00
|
|
|
P p;
|
|
|
|
P p_arr[3];
|
|
|
|
Q q_arr[2][3];
|
2009-08-18 03:04:50 +08:00
|
|
|
};
|
2010-01-27 11:03:08 +08:00
|
|
|
|
|
|
|
// CHECK: define i32 @_Z1fv() nounwind
|
|
|
|
int f() {
|
|
|
|
{
|
|
|
|
count = 1;
|
|
|
|
M a;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: ret i32 1
|
|
|
|
return count;
|
|
|
|
}
|