// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist// RUN: FileCheck --input-file=%t.plist %stypedefstructdispatch_queue_s*dispatch_queue_t;typedefvoid(^dispatch_block_t)(void);voiddispatch_sync(dispatch_queue_t,dispatch_block_t);@interfaceTest@propertyint*p;@endint*getZeroIfNil(Test*x){returnx.p;// expected-note@-1 {{'p' not called because the receiver is nil}}// expected-note@-2 {{Returning null pointer}}}voidtestReturnZeroIfNil(){*getZeroIfNil(0)=1;// expected-warning{{Dereference of null pointer}}// expected-note@-1 {{Calling 'getZeroIfNil'}}// expected-note@-2 {{Passing nil object reference via 1st parameter 'x'}}// expected-note@-3 {{Returning from 'getZeroIfNil'}}// expected-note@-4 {{Dereference of null pointer}}}inttestDispatchSyncInlining(){externdispatch_queue_tglobalQueue;__blockintx;// expected-note@+2 {{Calling 'dispatch_sync'}}// expected-note@+1 {{Returning from 'dispatch_sync'}}dispatch_sync(globalQueue,^{// expected-note@7 {{Calling anonymous block}}x=0;// expected-note@-1 {{The value 0 is assigned to 'x'}}// expected-note@7 {{Returning to caller}}});return1/x;// expected-warning{{Division by zero}}// expected-note@-1 {{Division by zero}}}inttestDispatchSyncInliningNoPruning(intcoin){// This tests exactly the same case as above, except on a bug report where// path pruning is disabled (an uninitialized variable capture).// In this case externdispatch_queue_tglobalQueue;__blockinty;// expected-note@+1 {{Calling 'dispatch_sync'}}dispatch_sync(globalQueue,^{// expected-note@7 {{Calling anonymous block}}intx;// expected-note@-1 {{'x' declared without an initial value}}^{y=x;}();// expected-warning{{Variable 'x' is uninitialized when captured by block}}// expected-note@-1 {{'x' is uninitialized when captured by block}}});returny;}@interfacePointerWrapper-(int*)getPtr;@endidgetNil(){return0;}voidtestNilReceiverHelper(int*x){*x=1;// expected-warning {{Dereference of null pointer}}// expected-note@-1 {{Dereference of null pointer (loaded from variable 'x')}}}voidtestNilReceiver(id*x){if(*x){// expected-note@-1 {{Taking false branch}}return;}testNilReceiverHelper([*xgetPtr]);// expected-note@-1 {{'getPtr' not called because the receiver is nil}}// expected-note@-2 {{Passing null pointer value via 1st parameter 'x'}}// expected-note@-3 {{Calling 'testNilReceiverHelper'}}}// CHECK: <key>diagnostics</key>// CHECK-NEXT: &l