[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / mutually_exclusive_null_fp.cpp
blobed3f2d09857c238eca014296ab7525afe878c0b6
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
3 // rdar://problem/56586853
4 // expected-no-diagnostics
6 struct Data {
7 int x;
8 Data *data;
9 };
11 int compare(Data &a, Data &b) {
12 Data *aData = a.data;
13 Data *bData = b.data;
15 // Covers the cases where both pointers are null as well as both pointing to the same buffer.
16 if (aData == bData)
17 return 0;
19 if (aData && !bData)
20 return 1;
22 if (!aData && bData)
23 return -1;
25 return compare(*aData, *bData); // no-warning