| 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 | |
| 7 | // DEBUGGER: break 24 |
| 8 | // DEBUGGER: r |
| 9 | // DEBUGGER: p result |
| 10 | // CHECK: ${{[0-9]}} = 42 |
| 11 | |
| 12 | void doBlock(void (^block)(void)) |
| 13 | { |
| 14 | block(); |
| 15 | } |
| 16 | |
| 17 | int I(int n) |
| 18 | { |
| 19 | __block int result; |
| 20 | int i = 2; |
| 21 | doBlock(block: ^{ |
| 22 | result = n; |
| 23 | }); |
| 24 | return result + i; /* Check value of 'result' */ |
| 25 | } |
| 26 | |
| 27 | |
| 28 | int main (int argc, const char * argv[]) { |
| 29 | return I(n: 42); |
| 30 | } |
| 31 | |
| 32 | |
| 33 | |