2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
|
2010-01-26 07:02:23 +03:00
|
|
|
|
|
|
|
// CHECK: @_ZZ1hvE1i = internal global i32 0, align 4
|
2010-02-07 05:03:08 +03:00
|
|
|
|
|
|
|
// CHECK: @_ZZ2h2vE1i = weak global i32 0
|
|
|
|
// CHECK: @_ZGVZ2h2vE1i = weak global i64 0
|
|
|
|
|
2009-08-09 01:45:14 +04:00
|
|
|
struct A {
|
|
|
|
A();
|
|
|
|
~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
void f() {
|
2009-12-10 04:05:11 +03:00
|
|
|
// CHECK: call void @_ZN1AC1Ev(
|
|
|
|
// CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @_ZZ1fvE1a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*))
|
2009-08-09 01:45:14 +04:00
|
|
|
static A a;
|
|
|
|
}
|
|
|
|
|
2009-12-10 04:05:11 +03:00
|
|
|
void g() {
|
2009-12-16 19:59:22 +03:00
|
|
|
// CHECK: call noalias i8* @_Znwm(i64 1)
|
2009-12-10 04:05:11 +03:00
|
|
|
// CHECK: call void @_ZN1AC1Ev(
|
|
|
|
static A& a = *new A;
|
|
|
|
}
|
2010-01-26 07:02:23 +03:00
|
|
|
|
|
|
|
int a();
|
|
|
|
void h() {
|
|
|
|
static const int i = a();
|
|
|
|
}
|
2010-02-07 05:03:08 +03:00
|
|
|
|
|
|
|
inline void h2() {
|
|
|
|
static int i = a();
|
|
|
|
}
|
|
|
|
|
|
|
|
void h3() {
|
|
|
|
h2();
|
|
|
|
}
|