aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/conditional-expr-6.m
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
commit51fb8b013e7734b795139f49d3b1f77c539be20a (patch)
tree59e0e47a9831dcf0e21e547927c8ebb7e113bfd1 /test/SemaObjC/conditional-expr-6.m
parent73490b890977362d28dd6326843a1ecae413921d (diff)
downloadsrc-51fb8b013e7734b795139f49d3b1f77c539be20a.tar.gz
src-51fb8b013e7734b795139f49d3b1f77c539be20a.zip
Update clang to r86025.vendor/clang/clang-r86025
Notes
Notes: svn path=/vendor/clang/dist/; revision=198893 svn path=/vendor/clang/clang-r86025/; revision=198895; tag=vendor/clang/clang-r86025
Diffstat (limited to 'test/SemaObjC/conditional-expr-6.m')
-rw-r--r--test/SemaObjC/conditional-expr-6.m51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/SemaObjC/conditional-expr-6.m b/test/SemaObjC/conditional-expr-6.m
new file mode 100644
index 000000000000..bba51bb8178f
--- /dev/null
+++ b/test/SemaObjC/conditional-expr-6.m
@@ -0,0 +1,51 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+@protocol MyProtocol @end
+
+@interface NSObject @end
+
+@interface NSInterm : NSObject <MyProtocol>
+@end
+
+@interface NSArray : NSInterm
+@end
+
+@interface NSSet : NSObject <MyProtocol>
+@end
+
+
+@interface N1 : NSObject
+@end
+
+@interface N1() <MyProtocol>
+@end
+
+NSObject* test (int argc) {
+ NSArray *array = ((void*)0);
+ NSSet *set = ((void*)0);
+ return (argc) ? set : array ;
+}
+
+
+NSObject* test1 (int argc) {
+ NSArray *array = ((void*)0);
+ NSSet *set = ((void*)0);
+ id <MyProtocol> instance = (argc) ? array : set;
+ id <MyProtocol> instance1 = (argc) ? set : array;
+
+ N1 *n1 = ((void*)0);
+ id <MyProtocol> instance2 = (argc) ? set : n1;
+ id <MyProtocol> instance3 = (argc) ? n1 : array;
+
+ NSArray<MyProtocol> *qual_array = ((void*)0);
+ id <MyProtocol> instance4 = (argc) ? array : qual_array;
+ id <MyProtocol> instance5 = (argc) ? qual_array : array;
+ NSSet<MyProtocol> *qual_set = ((void*)0);
+ id <MyProtocol> instance6 = (argc) ? qual_set : qual_array;
+ id <MyProtocol> instance7 = (argc) ? qual_set : array;
+ id <MyProtocol> instance8 = (argc) ? qual_array : set;
+ id <MyProtocol> instance9 = (argc) ? qual_array : qual_set;
+
+
+ return (argc) ? array : set;
+}