// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -emit-llvm -triple=thumbv6m-eabi -o - %s | FileCheck %s

int f();

// CHECK-LABEL: @_Z1gv(
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[TMP0:%.*]] = call i32 @__cxa_guard_acquire(ptr @_ZGVZ1gvE1a) #[[ATTR1:[0-9]+]]
// CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
// CHECK-NEXT:    br i1 [[TOBOOL]], label [[INIT:%.*]], label [[INIT_END:%.*]]
// CHECK:       init:
// CHECK-NEXT:    [[CALL:%.*]] = call noundef i32 @_Z1fv()
// CHECK-NEXT:    store i32 [[CALL]], ptr @_ZZ1gvE1a, align 4
// CHECK-NEXT:    call void @__cxa_guard_release(ptr @_ZGVZ1gvE1a) #[[ATTR1]]
// CHECK-NEXT:    br label [[INIT_END]]
// CHECK:       init.end:
// CHECK-NEXT:    ret void
//
void g() {
  static int a = f();
}
