objects_under_construction.cpp
1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
// RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
// RUN: -analyze-function "test()" \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot %s
// RUN: %exploded_graph_rewriter %t.dot | FileCheck %s
// REQUIRES: asserts
struct S {
S() {}
};
void test() {
// CHECK: Objects Under Construction:
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left"><b>#0 Call</b></td>
// CHECK-SAME: <td align="left" colspan="2">
// CHECK-SAME: <font color="gray60">test </font>
// CHECK-SAME: </td>
// CHECK-SAME: </tr>
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left"><i>S{{[0-9]*}}</i></td>
// CHECK-SAME: <td align="left"><font color="darkgreen"><i>
// CHECK-SAME: (materialize temporary)
// CHECK-SAME: </i></font></td>
// CHECK-SAME: <td align="left">S()</td>
// CHECK-SAME: <td align="left">&s</td>
// CHECK-SAME: </tr>
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left"><i>S{{[0-9]*}}</i></td>
// CHECK-SAME: <td align="left"><font color="darkgreen"><i>
// CHECK-SAME: (elide constructor)
// CHECK-SAME: </i></font></td>
// CHECK-SAME: <td align="left">S()</td>
// CHECK-SAME: <td align="left">&s</td>
// CHECK-SAME: </tr>
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left"><i>S{{[0-9]*}}</i></td>
// CHECK-SAME: <td align="left"><font color="darkgreen"><i>
// CHECK-SAME: (construct into local variable)
// CHECK-SAME: </i></font></td>
// CHECK-SAME: <td align="left">S s = S();</td>
// CHECK-SAME: <td align="left">&s</td>
// CHECK-SAME: </tr>
S s = S();
}