blob: 956d0dfb595a0ce8d19c412b542667f410782c34 [file] [log] [blame]
Ted Kremenek9f67ede2008-10-01 05:05:46 +00001// RUN: clang -checker-cfref --verify %s
2
3// Reduced test case from crash in <rdar://problem/6253157>
4@class NSObject;
5@interface A @end
6@implementation A
7- (void)foo:(void (^)(NSObject *x))block {
8 if (!((block != ((void *)0)))) {}
9}
10@end
11
Ted Kremenek6dfe2f52008-10-18 22:20:20 +000012// Reduced test case from crash in PR 2796;
13// http://llvm.org/bugs/show_bug.cgi?id=2796
14
15unsigned foo(unsigned x) { return __alignof__((x)) + sizeof(x); }
Ted Kremenek9253b0f2008-10-20 23:14:31 +000016
17// Improvement to path-sensitivity involving compound assignments.
18// Addresses false positive in <rdar://problem/6268365>
19//
20
21unsigned r6268365Aux();
22
23void r6268365() {
24 unsigned x = 0;
25 x &= r6268365Aux();
26 unsigned j = 0;
27
28 if (x == 0) ++j;
29 if (x == 0) x = x / j; // no-warning
30}
31