summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/block_var.m
blob: 548cdd08438f37ecc052cc667ad93047160ba17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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
// RUN: %test_debuginfo %s %t.out 

// REQUIRES: system-darwin

// DEBUGGER: break 24
// DEBUGGER: r
// DEBUGGER: p result
// CHECK: ${{[0-9]}} = 42

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);
}


OpenPOWER on IntegriCloud