xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-block-consts.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D__block="" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3*f4a2713aSLionel Sambuc// rdar:// 8243071
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucvoid x(int y) {}
6*f4a2713aSLionel Sambucvoid f() {
7*f4a2713aSLionel Sambuc    const int bar = 3;
8*f4a2713aSLionel Sambuc    int baz = 4;
9*f4a2713aSLionel Sambuc    __block int bab = 4;
10*f4a2713aSLionel Sambuc    __block const int bas = 5;
11*f4a2713aSLionel Sambuc    void (^b)() = ^{
12*f4a2713aSLionel Sambuc        x(bar);
13*f4a2713aSLionel Sambuc        x(baz);
14*f4a2713aSLionel Sambuc	x(bab);
15*f4a2713aSLionel Sambuc	x(bas);
16*f4a2713aSLionel Sambuc	b();
17*f4a2713aSLionel Sambuc    };
18*f4a2713aSLionel Sambuc    b();
19*f4a2713aSLionel Sambuc}
20