[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / threadsafe-statics-no-atomic.cpp
blobdcfb49d0af092e96b2ebf1054461ac765eb226d4
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -emit-llvm -triple=thumbv6m-eabi -o - %s | FileCheck %s
4 int f();
6 // CHECK-LABEL: @_Z1gv(
7 // CHECK-NEXT: entry:
8 // CHECK-NEXT: [[TMP0:%.*]] = call i32 @__cxa_guard_acquire(ptr @_ZGVZ1gvE1a) #[[ATTR1:[0-9]+]]
9 // CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
10 // CHECK-NEXT: br i1 [[TOBOOL]], label [[INIT:%.*]], label [[INIT_END:%.*]]
11 // CHECK: init:
12 // CHECK-NEXT: [[CALL:%.*]] = call noundef i32 @_Z1fv()
13 // CHECK-NEXT: store i32 [[CALL]], ptr @_ZZ1gvE1a, align 4
14 // CHECK-NEXT: call void @__cxa_guard_release(ptr @_ZGVZ1gvE1a) #[[ATTR1]]
15 // CHECK-NEXT: br label [[INIT_END]]
16 // CHECK: init.end:
17 // CHECK-NEXT: ret void
19 void g() {
20 static int a = f();