[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / nullability-arc.mm
blob5c68dda42ed3cafb9a0d7a8b7ece98e24e3991c8
1 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core,nullability\
2 // RUN:                       -analyzer-output=text -verify %s
3 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core,nullability\
4 // RUN:                       -analyzer-output=text -verify %s -fobjc-arc
6 #if !__has_feature(objc_arc)
7 // expected-no-diagnostics
8 #endif
11 #define nil ((id)0)
13 @interface Param
14 @end
16 @interface Base
17 - (void)foo:(Param *_Nonnull)param;
18 @end
20 @interface Derived : Base
21 @end
23 @implementation Derived
24 - (void)foo:(Param *)param {
25   // FIXME: Why do we not emit the warning under ARC?
26   [super foo:param];
27 #if __has_feature(objc_arc)
28   // expected-warning@-2{{nil passed to a callee that requires a non-null 1st parameter}}
29   // expected-note@-3   {{nil passed to a callee that requires a non-null 1st parameter}}
30 #endif
32   [self foo:nil];
33 #if __has_feature(objc_arc)
34   // expected-note@-2{{Calling 'foo:'}}
35   // expected-note@-3{{Passing nil object reference via 1st parameter 'param'}}
36 #endif
38 @end