blob: 7e5b08adbe8e251b7bf7744dd50faf80c3bdcee9 [file] [log] [blame]
Blaine Garst86d0ba42010-08-04 23:34:21 +00001//
2// The LLVM Compiler Infrastructure
3//
4// This file is distributed under the University of Illinois Open Source
5// License. See LICENSE.TXT for details.
6
7/*
8 * goto.c
9 * testObjects
10 *
11 * Created by Blaine Garst on 10/17/08.
12 *
13 */
14
15// CONFIG rdar://6289031
16
17#include <stdio.h>
18
19int main(int argc, char *argv[])
20{
21 __block int val = 0;
22
23 ^{ val = 1; }();
24
25 if (val == 0) {
26 goto out_bad; // error: local byref variable val is in the scope of this goto
27 }
28
29 printf("%s: Success!\n", argv[0]);
30 return 0;
31out_bad:
32 printf("%s: val not updated!\n", argv[0]);
33 return 1;
34}