Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / html_diagnostics / control-arrows.cpp
blobc913c348f48d7650a58f8f48bc9bab65fcb0dfbf
1 // RUN: rm -fR %t
2 // RUN: mkdir %t
3 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
4 // RUN: -analyzer-output=html -o %t -verify %s
5 // RUN: cat %t/report-*.html | FileCheck %s
7 int dereference(int *x) {
8 return *x; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
11 int foobar(bool cond, int *x) {
12 if (cond)
13 x = 0;
14 return dereference(x);
17 // CHECK: <svg
18 // CHECK: <g
19 // 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>
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>