From cc6a44b8bdecd9fc70211146e8ba3853b1fac784 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 5 May 2010 15:38:32 +0000 Subject: For thread-safe static initialization of local statics with destructors, place the __cxa_atexit call after the __cxa_guard_release call, mimicking GCC/LLVM-GCC behavior. Noticed while debugging something related. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103088 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/static-init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/CodeGenCXX/static-init.cpp') diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index 750da02603..f9604d9643 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -11,7 +11,9 @@ struct A { }; void f() { - // CHECK: call void @_ZN1AC1Ev( + // CHECK: call i32 @__cxa_guard_acquire + // CHECK: call void @_ZN1AC1Ev + // CHECK: call void @__cxa_guard_release // 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*)) static A a; } -- cgit v1.2.3-70-g09d2