brintos

brintos / llvm-project-archived public Read only

0
0
Text · 757 B · 1510c12 Raw
37 lines · plain
1// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,debug.ExprInspection %s -verify2 3void clang_analyzer_hashDump(int);4 5@protocol NSObject6+ (id)alloc;7- (id)init;8@end9 10@protocol NSCopying11@end12 13__attribute__((objc_root_class))14@interface NSObject <NSObject>15- (void)method:(int)arg param:(int)arg2;16@end17 18@implementation NSObject19+ (id)alloc {20  return 0;21}22- (id)init {23  return self;24}25- (void)method:(int)arg param:(int)arg2 {26  clang_analyzer_hashDump(5); // expected-warning {{debug.ExprInspection$NSObject::method:param:$27$clang_analyzer_hashDump(5);$Category}}27}28@end29 30 31void testBlocks(void) {32  int x = 5;33  ^{34    clang_analyzer_hashDump(x); // expected-warning {{debug.ExprInspection$$29$clang_analyzer_hashDump(x);$Category}}35  }();36}37