1 | // |
2 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
3 | // See https://llvm.org/LICENSE.txt for license information. |
4 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
5 | |
6 | /* |
7 | * goto.c |
8 | * testObjects |
9 | * |
10 | * Created by Blaine Garst on 10/17/08. |
11 | * |
12 | */ |
13 | |
14 | // CONFIG rdar://6289031 |
15 | |
16 | #include <stdio.h> |
17 | |
18 | int main(int argc, char *argv[]) |
19 | { |
20 | __block int val = 0; |
21 | |
22 | ^{ val = 1; }(); |
23 | |
24 | if (val == 0) { |
25 | goto out_bad; // error: local byref variable val is in the scope of this goto |
26 | } |
27 | |
28 | printf(format: "%s: Success!\n" , argv[0]); |
29 | return 0; |
30 | out_bad: |
31 | printf(format: "%s: val not updated!\n" , argv[0]); |
32 | return 1; |
33 | } |
34 | |