2017-10-30 20:02:23 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,debug.ExprInspection %s -verify
|
|
|
|
|
|
|
|
void clang_analyzer_hashDump(int);
|
2015-10-22 19:53:04 +08:00
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
+ (id)alloc;
|
|
|
|
- (id)init;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSCopying
|
|
|
|
@end
|
|
|
|
|
|
|
|
__attribute__((objc_root_class))
|
|
|
|
@interface NSObject <NSObject>
|
|
|
|
- (void)method:(int)arg param:(int)arg2;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation NSObject
|
2017-10-30 20:02:23 +08:00
|
|
|
+ (id)alloc {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
- (id)init {
|
|
|
|
return self;
|
|
|
|
}
|
2015-10-22 19:53:04 +08:00
|
|
|
- (void)method:(int)arg param:(int)arg2 {
|
2017-10-30 20:02:23 +08:00
|
|
|
clang_analyzer_hashDump(5); // expected-warning {{debug.ExprInspection$NSObject::method:param:$27$clang_analyzer_hashDump(5);$Category}}
|
2015-10-22 19:53:04 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
void testBlocks() {
|
|
|
|
int x = 5;
|
2017-10-30 20:02:23 +08:00
|
|
|
^{
|
|
|
|
clang_analyzer_hashDump(x); // expected-warning {{debug.ExprInspection$$29$clang_analyzer_hashDump(x);$Category}}
|
|
|
|
}();
|
2015-10-22 19:53:04 +08:00
|
|
|
}
|