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