[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / 2009-01-05-BlockInlining.c
blobb9b1a9ee5e6f015fbcce4ec969448776a9a011a8
1 // RUN: %clang_cc1 %s -triple x86_64-linux -emit-llvm -fblocks -o - | FileCheck %s
2 // rdar://5865221
4 // These will be inlined by the optimizers provided the block descriptors
5 // and block literals are internal constants.
6 // CHECK: @__block_descriptor_tmp = internal constant
7 // CHECK: @__block_literal_global = internal constant
8 // CHECK: @__block_descriptor_tmp.2 = internal constant
9 // CHECK: @__block_literal_global.3 = internal constant
10 static int fun(int x) {
11 return x+1;
14 static int block(int x) {
15 return (^(int x){return x+1;})(x);
18 extern int printf(const char *, ...);
19 static void print(int result) {
20 printf("%d\n", result);
23 int main (int argc, const char * argv[]) {
24 int x = argc-1;
25 print(fun(x));
26 print(block(x));
27 int (^block_inline)(int) = ^(int x){return x+1;};
28 print(block_inline(x));
29 return 0;