From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaObjC/compare-qualified-class.m | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 clang/test/SemaObjC/compare-qualified-class.m (limited to 'clang/test/SemaObjC/compare-qualified-class.m') diff --git a/clang/test/SemaObjC/compare-qualified-class.m b/clang/test/SemaObjC/compare-qualified-class.m new file mode 100644 index 0000000..0f415b6 --- /dev/null +++ b/clang/test/SemaObjC/compare-qualified-class.m @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar://8191774 + +@protocol SomeProtocol +@end + +@protocol SomeProtocol1 +@end + +@interface SomeObject +@end + +int main () { + Class classA; + Class classB; + Class classC; + Class classD; + void * pv = 0; + Class c = (Class)0;; + if (pv) + return classA == pv; + + if (c) + return classA == c; + + return classA == classB || classA == classC || + classC == classA || + classA == classD; // expected-warning {{comparison of distinct pointer types ('Class *' and 'Class *')}} +} + -- cgit v1.2.3