Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck %s |
Anders Carlsson | 89ed31d | 2009-08-08 23:24:23 +0000 | [diff] [blame] | 2 | |
| 3 | struct A { |
| 4 | A(); |
| 5 | ~A(); |
| 6 | }; |
| 7 | |
Anders Carlsson | 74d644a | 2009-10-08 17:28:59 +0000 | [diff] [blame] | 8 | struct B { B(); ~B(); }; |
| 9 | |
John McCall | fb8b69a | 2010-02-02 08:02:49 +0000 | [diff] [blame^] | 10 | struct C { void *field; }; |
| 11 | |
| 12 | // CHECK: @c = global %struct.C zeroinitializer, align 8 |
| 13 | |
Anders Carlsson | 74d644a | 2009-10-08 17:28:59 +0000 | [diff] [blame] | 14 | // CHECK: call void @_ZN1AC1Ev(%struct.A* @a) |
Anders Carlsson | a3f36ab | 2009-10-08 17:22:47 +0000 | [diff] [blame] | 15 | // 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*)) |
Anders Carlsson | 89ed31d | 2009-08-08 23:24:23 +0000 | [diff] [blame] | 16 | A a; |
Anders Carlsson | 74d644a | 2009-10-08 17:28:59 +0000 | [diff] [blame] | 17 | |
| 18 | // CHECK: call void @_ZN1BC1Ev(%struct.A* @b) |
| 19 | // 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*)) |
| 20 | B b; |
John McCall | fb8b69a | 2010-02-02 08:02:49 +0000 | [diff] [blame^] | 21 | |
| 22 | // PR6205: this should not require a global initializer |
| 23 | // CHECK-NOT: call void @_ZN1CC1Ev(%struct.C* @c) |
| 24 | C c; |
| 25 | |
| 26 | // CHECK: define internal void @__cxx_global_initialization() { |