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 { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** null, |
9 | |
10 | // Check that _NSConcreteGlobalBlock has the correct dllimport specifier. |
11 | // CHECK: @_NSConcreteGlobalBlock = external dllimport global i8* |
12 | // Check that we create an initialiser pointer in the correct section (early library initialisation). |
13 | // CHECK: @.block_isa_init_ptr = internal constant void ()* @.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 i8** @_NSConcreteGlobalBlock, i8*** getelementptr inbounds ({ i8**, i32, i32, i8*, %struct.__block_descriptor* }, { i8**, i32, i32, i8*, %struct.__block_descriptor* }* @__block_literal_global, i32 0, i32 0), align 4 |
18 | |
19 | |