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/Analysis/ObjCRetSigs.m | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 clang/test/Analysis/ObjCRetSigs.m (limited to 'clang/test/Analysis/ObjCRetSigs.m') 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 -- cgit v1.2.3