summaryrefslogtreecommitdiff
path: root/clang/test/Rewriter/objc-bool-literal-modern.mm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Rewriter/objc-bool-literal-modern.mm')
-rw-r--r--clang/test/Rewriter/objc-bool-literal-modern.mm23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Rewriter/objc-bool-literal-modern.mm b/clang/test/Rewriter/objc-bool-literal-modern.mm
new file mode 100644
index 0000000..328ee6b
--- /dev/null
+++ b/clang/test/Rewriter/objc-bool-literal-modern.mm
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -D"__declspec(X)=" %t-rw.cpp
+// rdar://11124775
+
+typedef bool BOOL;
+
+BOOL yes() {
+ return __objc_yes;
+}
+
+BOOL no() {
+ return __objc_no;
+}
+
+BOOL which (int flag) {
+ return flag ? yes() : no();
+}
+
+int main() {
+ which (__objc_yes);
+ which (__objc_no);
+ return __objc_yes;
+}