2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck %s
|
2009-08-09 03:24:23 +04:00
|
|
|
|
|
|
|
struct A {
|
|
|
|
A();
|
|
|
|
~A();
|
|
|
|
};
|
|
|
|
|
2009-10-08 21:28:59 +04:00
|
|
|
struct B { B(); ~B(); };
|
|
|
|
|
2010-02-02 11:02:49 +03:00
|
|
|
struct C { void *field; };
|
|
|
|
|
2010-02-05 21:38:45 +03:00
|
|
|
struct D { ~D(); };
|
|
|
|
|
2010-02-02 11:02:49 +03:00
|
|
|
// CHECK: @c = global %struct.C zeroinitializer, align 8
|
|
|
|
|
2009-10-08 21:28:59 +04:00
|
|
|
// CHECK: call void @_ZN1AC1Ev(%struct.A* @a)
|
2009-10-08 21:22:47 +04:00
|
|
|
// CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*))
|
2009-08-09 03:24:23 +04:00
|
|
|
A a;
|
2009-10-08 21:28:59 +04:00
|
|
|
|
|
|
|
// CHECK: call void @_ZN1BC1Ev(%struct.A* @b)
|
|
|
|
// CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1BD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @b, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*))
|
|
|
|
B b;
|
2010-02-02 11:02:49 +03:00
|
|
|
|
|
|
|
// PR6205: this should not require a global initializer
|
|
|
|
// CHECK-NOT: call void @_ZN1CC1Ev(%struct.C* @c)
|
|
|
|
C c;
|
|
|
|
|
2010-02-05 21:38:45 +03:00
|
|
|
// CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1DD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @d, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*))
|
|
|
|
D d;
|
|
|
|
|
2010-02-02 11:02:49 +03:00
|
|
|
// CHECK: define internal void @__cxx_global_initialization() {
|