Gabor Horvath | 3bd24f9 | 2017-10-30 12:02:23 +0000 | [diff] [blame^] | 1 | // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,debug.ExprInspection %s -verify |
| 2 | |
| 3 | void clang_analyzer_hashDump(int); |
Gabor Horvath | efec163 | 2015-10-22 11:53:04 +0000 | [diff] [blame] | 4 | |
| 5 | @protocol NSObject |
| 6 | + (id)alloc; |
| 7 | - (id)init; |
| 8 | @end |
| 9 | |
| 10 | @protocol NSCopying |
| 11 | @end |
| 12 | |
| 13 | __attribute__((objc_root_class)) |
| 14 | @interface NSObject <NSObject> |
| 15 | - (void)method:(int)arg param:(int)arg2; |
| 16 | @end |
| 17 | |
| 18 | @implementation NSObject |
Gabor Horvath | 3bd24f9 | 2017-10-30 12:02:23 +0000 | [diff] [blame^] | 19 | + (id)alloc { |
| 20 | return 0; |
| 21 | } |
| 22 | - (id)init { |
| 23 | return self; |
| 24 | } |
Gabor Horvath | efec163 | 2015-10-22 11:53:04 +0000 | [diff] [blame] | 25 | - (void)method:(int)arg param:(int)arg2 { |
Gabor Horvath | 3bd24f9 | 2017-10-30 12:02:23 +0000 | [diff] [blame^] | 26 | clang_analyzer_hashDump(5); // expected-warning {{debug.ExprInspection$NSObject::method:param:$27$clang_analyzer_hashDump(5);$Category}} |
Gabor Horvath | efec163 | 2015-10-22 11:53:04 +0000 | [diff] [blame] | 27 | } |
| 28 | @end |
| 29 | |
| 30 | |
| 31 | void testBlocks() { |
| 32 | int x = 5; |
Gabor Horvath | 3bd24f9 | 2017-10-30 12:02:23 +0000 | [diff] [blame^] | 33 | ^{ |
| 34 | clang_analyzer_hashDump(x); // expected-warning {{debug.ExprInspection$$29$clang_analyzer_hashDump(x);$Category}} |
| 35 | }(); |
Gabor Horvath | efec163 | 2015-10-22 11:53:04 +0000 | [diff] [blame] | 36 | } |