2014-10-19 07:47:59 +08:00
|
|
|
// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
|
|
|
|
// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation
|
2011-01-11 08:31:01 +08:00
|
|
|
// RUN: %test_debuginfo %s %t.out
|
2012-10-20 09:38:50 +08:00
|
|
|
|
|
|
|
// REQUIRES: system-darwin
|
2011-01-11 08:31:01 +08:00
|
|
|
|
2011-05-29 11:51:55 +08:00
|
|
|
// DEBUGGER: break 24
|
2011-01-11 08:31:01 +08:00
|
|
|
// DEBUGGER: r
|
|
|
|
// DEBUGGER: p result
|
2014-02-21 03:51:07 +08:00
|
|
|
// CHECK: ${{[0-9]}} = 42
|
2011-01-11 08:31:01 +08:00
|
|
|
|
|
|
|
void doBlock(void (^block)(void))
|
|
|
|
{
|
|
|
|
block();
|
|
|
|
}
|
|
|
|
|
|
|
|
int I(int n)
|
|
|
|
{
|
|
|
|
__block int result;
|
|
|
|
int i = 2;
|
|
|
|
doBlock(^{
|
|
|
|
result = n;
|
|
|
|
});
|
|
|
|
return result + i; /* Check value of 'result' */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main (int argc, const char * argv[]) {
|
|
|
|
return I(42);
|
|
|
|
}
|
|
|
|
|
|
|
|
|