brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · c913c34 Raw
31 lines · cpp
1// RUN: rm -fR %t2// RUN: mkdir %t3// RUN: %clang_analyze_cc1 -analyzer-checker=core \4// RUN:                    -analyzer-output=html -o %t -verify %s5// RUN: cat %t/report-*.html | FileCheck %s6 7int dereference(int *x) {8  return *x; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}9}10 11int foobar(bool cond, int *x) {12  if (cond)13    x = 0;14  return dereference(x);15}16 17// CHECK:          <svg18// CHECK:            <g19// CHECK-COUNT-9:      <path class="arrow" id="arrow{{[0-9]+}}"/>20// CHECK-NOT:          <path class="arrow" id="arrow{{[0-9]+}}"/>21// CHECK:            </g>22// CHECK-NEXT:     </svg>23// CHECK-NEXT:     <script type='text/javascript'>24// CHECK-NEXT:     const arrowIndices = [ 9,8,6,5,3,2,0 ]25// CHECK-NEXT:     </script>26//27// Except for arrows we still want to have grey bubbles with control notes.28// CHECK:          <div id="Path2" class="msg msgControl"29// CHECK-SAME:       <div class="PathIndex PathIndexControl">2</div>30// CHECK-SAME:       <td>Taking true branch</td>31