xref: /llvm-project/clang/test/CodeGen/global-blocks-win32.c (revision 8421307b6b165778260b9814ca4d2256bc3711df)
1 // RUN: %clang_cc1 -fblocks -triple i386-pc-windows-msvc %s -emit-llvm -o - -fblocks | FileCheck %s
2 
3 
4 int (^x)(void) = ^() { return 21; };
5 
6 
7 // Check that the block literal is emitted with a null isa pointer
8 // CHECK: @__block_literal_global = internal global { ptr, i32, i32, ptr, ptr } { ptr null,
9 
10 // Check that _NSConcreteGlobalBlock has the correct dllimport specifier.
11 // CHECK: @_NSConcreteGlobalBlock = external dllimport global ptr
12 // Check that we create an initialiser pointer in the correct section (early library initialisation).
13 // CHECK: @.block_isa_init_ptr = internal constant ptr @.block_isa_init, section ".CRT$XCLa"
14 
15 // Check that we emit an initialiser for it.
16 // CHECK: define internal void @.block_isa_init() {
17 // CHECK: store ptr @_NSConcreteGlobalBlock, ptr @__block_literal_global, align 4
18 
19