summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/ObjCRetSigs.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/ObjCRetSigs.m')
-rw-r--r--clang/test/Analysis/ObjCRetSigs.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Analysis/ObjCRetSigs.m b/clang/test/Analysis/ObjCRetSigs.m
new file mode 100644
index 0000000..13078a3
--- /dev/null
+++ b/clang/test/Analysis/ObjCRetSigs.m
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s
+
+int printf(const char *, ...);
+
+@interface MyBase
+-(long long)length;
+@end
+
+@interface MySub : MyBase{}
+-(double)length;
+@end
+
+@implementation MyBase
+-(long long)length{
+ printf("Called MyBase -length;\n");
+ return 3;
+}
+@end
+
+@implementation MySub
+-(double)length{ // expected-warning{{types are incompatible}}
+ printf("Called MySub -length;\n");
+ return 3.3;
+}
+@end