1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix=WITH-TSS %s
2 // RUN: %clang_cc1 -emit-llvm -o - %s -fno-threadsafe-statics | FileCheck -check-prefix=NO-TSS %s
3 
4 int f();
5 
6 // WITH-TSS: define void @_Z1gv() nounwind
7 // WITH-TSS: call i32 @__cxa_guard_acquire
8 // WITH-TSS: call void @__cxa_guard_release
9 // WITH-TSS: ret void
10 void g() {
11   static int a = f();
12 }
13 
14 // NO-TSS: define void @_Z1gv() nounwind
15 // NO-TSS-NOT: call i32 @__cxa_guard_acquire
16 // NO-TSS-NOT: call void @__cxa_guard_release
17 // NO-TSS: ret void
18