1 // RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck %s
3 // CHECK-DAG: @_ZZZN26externally_visible_statics1S3fooEiEd_Ub_E1k = linkonce_odr global i32 0
4 // CHECK-DAG: @_ZZZN26externally_visible_statics10inlinefuncEvEUb_E1i = linkonce_odr global i32 0
5 // CHECK-DAG: @_ZZZN26externally_visible_statics10inlinefuncEvEUb0_E1j = linkonce_odr global i32 0
6 // CHECK-DAG: @_ZZ26externally_visible_statics1S1xMUb_E1j = linkonce_odr global i32 0
11 // CHECK-LABEL: define internal noundef i32 @___Z3foov_block_invoke
12 // CHECK: call i32 @__cxa_guard_acquire(ptr @_ZGVZZ3foovEUb_E5value
14 static int value = f();
19 // CHECK-LABEL: define internal noundef i32 @i_block_invoke
20 int i = ^(int x) { return x;}(i);
28 // CHECK: define internal noundef signext i8 @"__11-[A method]_block_invoke"
30 // CHECK: @"_ZZZ11-[A method]EUb1_E4name"
31 static const char *name = "hello";
39 static const char *name = "hello";
45 // CHECK-LABEL: define internal noundef signext i8 @___Z3fooi_block_invoke
48 // CHECK: @_ZZZN1N3barEvEUb3_E4name
49 static const char *name = "hello";
60 // CHECK: @_ZZZN1CC1EvEUb4_E5nameb
61 static const char *nameb = "hello";
67 namespace externally_visible_statics {
68 inline void inlinefunc() {
81 void foo(int y = ^{ static int k = f(); return k; }()) {}