1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s | FileCheck -check-prefix=WITH-TSS %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -triple=x86_64-apple-darwin10 -o - %s -fno-threadsafe-statics | FileCheck -check-prefix=NO-TSS %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc int f();
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc // WITH-TSS: @_ZZ1gvE1a = internal global i32 0, align 4
7*f4a2713aSLionel Sambuc // WITH-TSS: @_ZGVZ1gvE1a = internal global i64 0
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambuc // WITH-TSS: define void @_Z1gv() [[NUW:#[0-9]+]]
10*f4a2713aSLionel Sambuc // WITH-TSS: call i32 @__cxa_guard_acquire
11*f4a2713aSLionel Sambuc // WITH-TSS: call void @__cxa_guard_release
12*f4a2713aSLionel Sambuc // WITH-TSS: ret void
g()13*f4a2713aSLionel Sambuc void g() {
14*f4a2713aSLionel Sambuc static int a = f();
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc // NO-TSS: @_ZZ1gvE1a = internal global i32 0, align 4
18*f4a2713aSLionel Sambuc // NO-TSS: @_ZGVZ1gvE1a = internal global i8 0
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc // NO-TSS: define void @_Z1gv() [[NUW:#[0-9]+]]
21*f4a2713aSLionel Sambuc // NO-TSS-NOT: call i32 @__cxa_guard_acquire
22*f4a2713aSLionel Sambuc // NO-TSS-NOT: call void @__cxa_guard_release
23*f4a2713aSLionel Sambuc // NO-TSS: ret void
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc // WITH-TSS: attributes [[NUW]] = { nounwind{{.*}} }
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc // NO-TSS: attributes [[NUW]] = { nounwind{{.*}} }
28