Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / nestedimport.c
blob01dfa7e7dc511a27bb513df0f6cc3c6ecb2ffba7
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 // nestedimport.m
8 // testObjects
9 //
10 // Created by Blaine Garst on 6/24/08.
12 // pure C nothing more needed
13 // CONFIG
16 #include <stdio.h>
17 #include <stdlib.h>
20 int Global = 0;
22 void callVoidVoid(void (^closure)(void)) {
23 closure();
26 int main(int argc, char *argv[]) {
27 int i = 1;
29 void (^vv)(void) = ^{
30 if (argc > 0) {
31 callVoidVoid(^{ Global = i; });
35 i = 2;
36 vv();
37 if (Global != 1) {
38 printf("%s: error, Global not set to captured value\n", argv[0]);
39 exit(1);
41 printf("%s: success\n", argv[0]);
42 return 0;