xref: /llvm-project/clang/test/CodeGenCXX/global-block-literal-helpers.cpp (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 -std=c++11 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
2 
3 namespace N {
4   typedef void (^BL)();
5   int func(BL, BL, BL);
6 
7 // CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke(
8 // CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke_2(
9 // CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke_3
10   BL ArrBlock [] = { ^{}, ^{}, ^{} };
11 
12 // CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_4(
13 // CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_5(
14 // CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_6(
15   int ival = func(^{}, ^{}, ^{});
16 
17 // CHECK-LABEL: define internal void @_ZN1N9gvarlobalE_block_invoke_7(
18   void (^gvarlobal)(void) = ^{};
19 
20   struct S {
21     BL field = ^{};
22   };
23 
24 // CHECK-LABEL: define internal void @_ZN1N3blfE_block_invoke_8(
25   S blf;
26 };
27