| 1 |
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o |
| 2 |
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation |
| 3 |
// RUN: %test_debuginfo %s %t.out |
| 4 |
|
| 5 |
// REQUIRES: system-darwin |
| 6 |
// Radar 9279956 |
| 7 |
|
| 8 |
// DEBUGGER: break 31 |
| 9 |
// DEBUGGER: r |
| 10 |
// DEBUGGER: p m2 |
| 11 |
// CHECK: ${{[0-9]}} = 1 |
| 12 |
// DEBUGGER: p dbTransaction |
| 13 |
// CHECK: ${{[0-9]}} = 0 |
| 14 |
// DEBUGGER: p controller |
| 15 |
// CHECK: ${{[0-9]}} = 0 |
| 16 |
|
| 17 |
#include <Cocoa/Cocoa.h> |
| 18 |
|
| 19 |
extern void foo(void(^)(void)); |
| 20 |
|
| 21 |
@interface A:NSObject @end |
| 22 |
@implementation A |
| 23 |
- (void) helper { |
| 24 |
int controller = 0; |
| 25 |
__block int m2 = 0; |
| 26 |
__block int dbTransaction = 0; |
| 27 |
int (^x)(void) = ^(void) { (void) self; |
| 28 |
(void) controller; |
| 29 |
(void) dbTransaction; |
| 30 |
m2++; |
| 31 |
return m2; |
| 32 |
}; |
| 33 |
controller = x(); |
| 34 |
} |
| 35 |
@end |
| 36 |
|
| 37 |
void foo(void(^x)(void)) {} |
| 38 |
|
| 39 |
int main() { |
| 40 |
A *a = [A alloc]; |
| 41 |
[a helper]; |
| 42 |
return 0; |
| 43 |
} |