]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/ObjCRetSigs.m
Vendor import of clang trunk r300422:
[FreeBSD/FreeBSD.git] / test / Analysis / ObjCRetSigs.m
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s
2
3 int printf(const char *, ...);
4
5 @interface MyBase
6 -(long long)length;
7 @end
8
9 @interface MySub : MyBase{}
10 -(double)length;
11 @end
12
13 @implementation MyBase
14 -(long long)length{
15    printf("Called MyBase -length;\n");
16    return 3;
17 }
18 @end
19
20 @implementation MySub
21 -(double)length{  // expected-warning{{types are incompatible}}
22    printf("Called MySub -length;\n");
23    return 3.3;
24 }
25 @end