blob: 8afc2746f42ed1208d2571df4447d1cb7170b992 [file] [log] [blame]
Anders Carlsson173d5122011-04-27 04:37:08 +00001// RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s | FileCheck -check-prefix=WITH-TSS %s
2// RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s -fno-threadsafe-statics | FileCheck -check-prefix=NO-TSS %s
Anders Carlssona508b7d2010-02-06 23:23:06 +00003
4int f();
5
Anders Carlsson173d5122011-04-27 04:37:08 +00006// WITH-TSS: @_ZZ1gvE1a = internal global i32 0, align 4
7// WITH-TSS: @_ZGVZ1gvE1a = internal global i64 0
8
Anders Carlssona508b7d2010-02-06 23:23:06 +00009// WITH-TSS: define void @_Z1gv() nounwind
10// WITH-TSS: call i32 @__cxa_guard_acquire
11// WITH-TSS: call void @__cxa_guard_release
12// WITH-TSS: ret void
13void g() {
14 static int a = f();
15}
16
Anders Carlsson173d5122011-04-27 04:37:08 +000017// NO-TSS: @_ZZ1gvE1a = internal global i32 0, align 4
18// NO-TSS: @_ZGVZ1gvE1a = internal global i8 0
19
Anders Carlssona508b7d2010-02-06 23:23:06 +000020// NO-TSS: define void @_Z1gv() nounwind
21// NO-TSS-NOT: call i32 @__cxa_guard_acquire
22// NO-TSS-NOT: call void @__cxa_guard_release
23// NO-TSS: ret void