Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / goto.c
blobcdc40d966d42b861e7e6f1d452a670d9f46aeff8
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
6 /*
7 * goto.c
8 * testObjects
10 * Created by Blaine Garst on 10/17/08.
14 // CONFIG rdar://6289031
16 #include <stdio.h>
18 int main(int argc, char *argv[])
20 __block int val = 0;
22 ^{ val = 1; }();
24 if (val == 0) {
25 goto out_bad; // error: local byref variable val is in the scope of this goto
28 printf("%s: Success!\n", argv[0]);
29 return 0;
30 out_bad:
31 printf("%s: val not updated!\n", argv[0]);
32 return 1;