__weak and __block when rewriting.
// rdar://
11236342
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154592
91177308-0d34-0410-b5e6-
96231b3b80d8
Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
Preamble += "#define __attribute__(X)\n";
Preamble += "#endif\n";
+ Preamble += "#ifndef __weak\n";
Preamble += "#define __weak\n";
+ Preamble += "#endif\n";
+ Preamble += "#ifndef __block\n";
+ Preamble += "#define __block\n";
+ Preamble += "#endif\n";
}
else {
Preamble += "#define __block\n";
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
// rdar://11230308
typedef struct {
x(&bytes);
};
}
+
+// rdar://11236342
+int foo() {
+ __block int hello;
+}