llvm-project
33 строки · 639.0 Байт
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
18int main(int argc, char *argv[])
19{
20__block int val = 0;
21
22^{ val = 1; }();
23
24if (val == 0) {
25goto out_bad; // error: local byref variable val is in the scope of this goto
26}
27
28printf("%s: Success!\n", argv[0]);
29return 0;
30out_bad:
31printf("%s: val not updated!\n", argv[0]);
32return 1;
33}
34