summaryrefslogtreecommitdiffstats
path: root/test/Analysis/ObjCRetSigs.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/ObjCRetSigs.m')
-rw-r--r--test/Analysis/ObjCRetSigs.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Analysis/ObjCRetSigs.m b/test/Analysis/ObjCRetSigs.m
new file mode 100644
index 0000000..0d69916
--- /dev/null
+++ b/test/Analysis/ObjCRetSigs.m
@@ -0,0 +1,25 @@
+// RUN: clang-cc -analyze -warn-objc-methodsigs -verify %s
+
+#include <stdio.h>
+
+@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
OpenPOWER on IntegriCloud