Adrian Prantl | 7959194 | 2013-04-02 01:00:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fblocks -g -emit-llvm %s -o - | FileCheck %s |
| 2 | // Make sure we do not generate line info for debugging-related frame setup. |
| 3 | // CHECK: define {{.*}}block_invoke |
Benjamin Kramer | 7d1be73 | 2013-04-02 13:38:42 +0000 | [diff] [blame] | 4 | // CHECK-NOT: store {{.*}}%struct.__block_descriptor*{{.*}}dbg |
| 5 | // CHECK: store {{.*}}%struct.__block_descriptor*{{.*}}, align |
Adrian Prantl | 7959194 | 2013-04-02 01:00:48 +0000 | [diff] [blame] | 6 | // CHECK: ret |
| 7 | // CHECK: define {{.*}}block_invoke |
Benjamin Kramer | 7d1be73 | 2013-04-02 13:38:42 +0000 | [diff] [blame] | 8 | // CHECK-NOT: store {{.*}}%struct.__block_descriptor*{{.*}}dbg |
| 9 | // CHECK: store {{.*}}%struct.__block_descriptor*{{.*}}, align |
Adrian Prantl | 7959194 | 2013-04-02 01:00:48 +0000 | [diff] [blame] | 10 | // CHECK: ret |
| 11 | // CHECK: define {{.*}}block_invoke |
Benjamin Kramer | 7d1be73 | 2013-04-02 13:38:42 +0000 | [diff] [blame] | 12 | // CHECK-NOT: store {{.*}}%struct.__block_descriptor*{{.*}}dbg |
| 13 | // CHECK: store {{.*}}%struct.__block_descriptor*{{.*}}, align |
Adrian Prantl | 7959194 | 2013-04-02 01:00:48 +0000 | [diff] [blame] | 14 | // CHECK: ret |
| 15 | int printf(const char*, ...); |
| 16 | |
| 17 | static void* _NSConcreteGlobalBlock; |
| 18 | |
| 19 | |
| 20 | typedef void (^ HelloBlock_t)(const char * name); |
| 21 | |
| 22 | /* Breakpoint for first Block function. */ |
| 23 | HelloBlock_t helloBlock = ^(const char * name) { |
| 24 | printf("Hello there, %s!\n", name); |
| 25 | }; |
| 26 | |
| 27 | /* Breakpoint for second Block function. */ |
| 28 | static HelloBlock_t s_helloBlock = ^(const char * name) { |
| 29 | printf("Hello there, %s!\n", name); |
| 30 | }; |
| 31 | |
| 32 | /* Breakpoint for third Block function. */ |
| 33 | int X = 1234; |
| 34 | int (^CP)(void) = ^{ X = X+1; return X; }; |
| 35 | |
| 36 | int |
| 37 | main(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 | } |