diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-14 18:35:06 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-14 18:35:06 +0000 |
commit | 799ad50ffb7b060bc993de42c2d1f74bf156d3b8 (patch) | |
tree | 7736558fb5276218ca520390350b8cb3789fbe36 /clang/test/Analysis/inlining/InlineObjCClassMethod.m | |
parent | 31bcf7cfc93d42931a05ea6288381681ba16210c (diff) | |
download | bcm5719-llvm-799ad50ffb7b060bc993de42c2d1f74bf156d3b8.tar.gz bcm5719-llvm-799ad50ffb7b060bc993de42c2d1f74bf156d3b8.zip |
[analyzer] Address Jordan's comments for r161822, r161683.
Add a TODO test case for r161822 - calling self from a class method.
Remove a TODO comment for r161683 - value2 is not a property - we just
have method names that look like they are getters/setters for a
property.
llvm-svn: 161884
Diffstat (limited to 'clang/test/Analysis/inlining/InlineObjCClassMethod.m')
-rw-r--r-- | clang/test/Analysis/inlining/InlineObjCClassMethod.m | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/Analysis/inlining/InlineObjCClassMethod.m b/clang/test/Analysis/inlining/InlineObjCClassMethod.m index 7e8b51fe0be..814d437a52d 100644 --- a/clang/test/Analysis/inlining/InlineObjCClassMethod.m +++ b/clang/test/Analysis/inlining/InlineObjCClassMethod.m @@ -179,3 +179,33 @@ int foo2() { int y = [MyParentSelf testSelf]; return 5/y; // Should warn here. } + +// TODO: We do not inline 'getNum' in the following case, where the value of +// 'self' in call '[self getNum]' is available and evaualtes to +// 'SelfUsedInParentChild' if it's called from fooA. +// Self region should get created before we call foo and yje call to super +// should keep it live. +@interface SelfUsedInParent : NSObject ++ (int)getNum; ++ (int)foo; +@end +@implementation SelfUsedInParent ++ (int)getNum {return 5;} ++ (int)foo { + return [self getNum]; +} +@end +@interface SelfUsedInParentChild : SelfUsedInParent ++ (int)getNum; ++ (int)fooA; +@end +@implementation SelfUsedInParentChild ++ (int)getNum {return 0;} ++ (int)fooA { + return [super foo]; +} +@end +int checkSelfUsedInparentClassMethod() { + return 5/[SelfUsedInParentChild fooA]; +} + |