summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/static-init.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-05 15:38:32 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-05 15:38:32 +0000
commit370eadf38dde939355c38bbc12ebe585dd22febe (patch)
treebe37d28f5f875de43367cdfebc6455d38f8325c7 /clang/test/CodeGenCXX/static-init.cpp
parent656bb314d99d6da5f4bab00216fbfaf50808a368 (diff)
downloadbcm5719-llvm-370eadf38dde939355c38bbc12ebe585dd22febe.tar.gz
bcm5719-llvm-370eadf38dde939355c38bbc12ebe585dd22febe.zip
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. llvm-svn: 103088
Diffstat (limited to 'clang/test/CodeGenCXX/static-init.cpp')
-rw-r--r--clang/test/CodeGenCXX/static-init.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/static-init.cpp b/clang/test/CodeGenCXX/static-init.cpp
index 750da02603b..f9604d96433 100644
--- a/clang/test/CodeGenCXX/static-init.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud