brintos

brintos / llvm-project-archived public Read only

0
0
Text · 639 B · cdc40d9 Raw
34 lines · c
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-exception5 6/*7 *  goto.c8 *  testObjects9 *10 *  Created by Blaine Garst on 10/17/08.11 *12 */13 14// CONFIG rdar://628903115 16#include <stdio.h>17 18int 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 goto26	}27 28        printf("%s: Success!\n", argv[0]);29	return 0;30out_bad:31        printf("%s: val not updated!\n", argv[0]);32	return 1;33}34