summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/self-comparison.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/self-comparison.m')
-rw-r--r--test/SemaObjC/self-comparison.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaObjC/self-comparison.m b/test/SemaObjC/self-comparison.m
new file mode 100644
index 0000000..00137ee
--- /dev/null
+++ b/test/SemaObjC/self-comparison.m
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+
+@interface A {
+ id xxx;
+}
+-(int)bar;
+@end
+@implementation A
+-(int)bar {
+ return xxx == xxx; // expected-warning {{self-comparison always evaluates to true}}
+}
+@end
OpenPOWER on IntegriCloud