46 lines · c
1// RUN: %clang_cc1 -fblocks -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s2// Make sure we do not generate line info for debugging-related frame setup.3// CHECK: define {{.*}}block_invoke4// CHECK-NOT: store {{.*}}ptr{{.*}}dbg5// CHECK: store {{.*}}ptr{{.*}}, align6// CHECK: ret7// CHECK: define {{.*}}block_invoke8// CHECK-NOT: store {{.*}}ptr{{.*}}dbg9// CHECK: store {{.*}}ptr{{.*}}, align10// CHECK: ret11// CHECK: define {{.*}}block_invoke12// CHECK-NOT: store {{.*}}ptr{{.*}}dbg13// CHECK: store {{.*}}ptr{{.*}}, align14// CHECK: ret15int printf(const char*, ...);16 17static void* _NSConcreteGlobalBlock;18 19 20typedef void (^ HelloBlock_t)(const char * name);21 22 /* Breakpoint for first Block function. */23HelloBlock_t helloBlock = ^(const char * name) {24 printf("Hello there, %s!\n", name);25};26 27 /* Breakpoint for second Block function. */28static HelloBlock_t s_helloBlock = ^(const char * name) {29 printf("Hello there, %s!\n", name);30};31 32/* Breakpoint for third Block function. */33int X = 1234;34int (^CP)(void) = ^{ X = X+1; return X; };35 36int37main(int argc, char * argv[])38{39 helloBlock("world");40 s_helloBlock("world");41 42 CP();43 printf ("X = %d\n", X);44 return X - 1235;45}46