[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / global-blocks-win32.c
blob2c4e2a62844818e96b01b43a376741953c6157d0
1 // RUN: %clang_cc1 -no-opaque-pointers -fblocks -triple i386-pc-windows-msvc %s -emit-llvm -o - -fblocks | FileCheck %s
4 int (^x)(void) = ^() { return 21; };
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,
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"
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