[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / arc-zero-init.m
blob831d7003cae98c9ee723628efa58f44472a053ce
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -fobjc-arc %s
4 #if __has_feature(objc_arc)
5 // expected-no-diagnostics
6 #endif
8 @interface SomeClass
9 @end
11 void simpleStrongPointerValue(void) {
12   SomeClass *x;
13   if (x) {}
14 #if !__has_feature(objc_arc)
15 // expected-warning@-2{{Branch condition evaluates to a garbage value}}
16 #endif
19 void simpleArray(void) {
20   SomeClass *vlaArray[5];
22   if (vlaArray[0]) {}
23 #if !__has_feature(objc_arc)
24 // expected-warning@-2{{Branch condition evaluates to a garbage value}}
25 #endif
28 void variableLengthArray(void) {
29    int count = 1;
30    SomeClass * vlaArray[count];
32    if (vlaArray[0]) {}
33 #if !__has_feature(objc_arc)
34   // expected-warning@-2{{Branch condition evaluates to a garbage value}}
35 #endif
38 void variableLengthArrayWithExplicitStrongAttribute(void) {
39    int count = 1;
40    __attribute__((objc_ownership(strong))) SomeClass * vlaArray[count];
42    if (vlaArray[0]) {}
43 #if !__has_feature(objc_arc)
44   // expected-warning@-2{{Branch condition evaluates to a garbage value}}
45 #endif