Skip to content

Commit c94582a

Browse files
authored
Merge pull request #2861 from MathiasVP/gvn-use-impl
C++: Import AST GVN module for tests
2 parents 5e0f21a + 3a05a82 commit c94582a

File tree

4 files changed

+144
-60
lines changed

4 files changed

+144
-60
lines changed
Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +0,0 @@
1-
| test.cpp:5:3:5:13 | ... = ... | |
2-
| test.cpp:6:3:6:13 | ... = ... | |
3-
| test.cpp:7:3:7:7 | ... = ... | |
4-
| test.cpp:10:16:10:16 | 1 | |
5-
| test.cpp:16:3:16:24 | ... = ... | |
6-
| test.cpp:17:3:17:24 | ... = ... | |
7-
| test.cpp:18:3:18:7 | ... = ... | |
8-
| test.cpp:21:16:21:16 | 2 | |
9-
| test.cpp:29:3:29:24 | ... = ... | |
10-
| test.cpp:30:3:30:17 | call to change_global02 | |
11-
| test.cpp:31:3:31:24 | ... = ... | |
12-
| test.cpp:32:3:32:7 | ... = ... | |
13-
| test.cpp:35:16:35:16 | 3 | |
14-
| test.cpp:43:3:43:24 | ... = ... | |
15-
| test.cpp:44:3:44:9 | ... = ... | |
16-
| test.cpp:45:3:45:24 | ... = ... | |
17-
| test.cpp:46:3:46:7 | ... = ... | |
18-
| test.cpp:51:25:51:25 | (unsigned int)... | |
19-
| test.cpp:53:10:53:13 | (int)... | |
20-
| test.cpp:53:10:53:13 | * ... | LoadTotalOverlap, Unary |
21-
| test.cpp:53:18:53:21 | (int)... | |
22-
| test.cpp:55:5:55:15 | ... = ... | |
23-
| test.cpp:56:12:56:25 | (...) | |
24-
| test.cpp:56:12:56:43 | ... && ... | |
25-
| test.cpp:56:13:56:16 | (int)... | |
26-
| test.cpp:56:13:56:16 | * ... | Unary, Unique |
27-
| test.cpp:56:21:56:24 | (int)... | |
28-
| test.cpp:56:21:56:24 | * ... | LoadTotalOverlap, Unary |
29-
| test.cpp:56:30:56:43 | (...) | |
30-
| test.cpp:56:31:56:34 | (int)... | |
31-
| test.cpp:56:31:56:34 | * ... | Unary, Unique |
32-
| test.cpp:56:39:56:42 | (int)... | |
33-
| test.cpp:56:47:56:51 | ... ++ | |
34-
| test.cpp:59:9:59:12 | (int)... | |
35-
| test.cpp:59:9:59:12 | * ... | Unary, Unique |
36-
| test.cpp:59:17:59:20 | (int)... | |
37-
| test.cpp:62:5:62:12 | ... ++ | |
38-
| test.cpp:77:20:77:28 | call to getAValue | Unary, Unique |
39-
| test.cpp:77:20:77:30 | (signed short)... | |
40-
| test.cpp:79:7:79:7 | (int)... | |
41-
| test.cpp:79:7:79:7 | v | Unary, Unary |
42-
| test.cpp:79:11:79:20 | (int)... | |
43-
| test.cpp:79:17:79:20 | val1 | LoadTotalOverlap, Unary |
44-
| test.cpp:79:24:79:33 | (int)... | |
45-
| test.cpp:79:30:79:33 | val2 | LoadTotalOverlap, Unary |
46-
| test.cpp:80:5:80:19 | ... = ... | |
47-
| test.cpp:80:9:80:17 | call to getAValue | Unary, Unique |
48-
| test.cpp:80:9:80:19 | (signed short)... | |
49-
| test.cpp:88:3:88:20 | ... = ... | |
50-
| test.cpp:88:12:88:12 | (void *)... | |
51-
| test.cpp:105:11:105:12 | (Base *)... | |
52-
| test.cpp:105:11:105:12 | pd | InheritanceConversion, InitializeParameter |
53-
| test.cpp:106:14:106:35 | static_cast<Base *>... | |
54-
| test.cpp:106:33:106:34 | pd | InheritanceConversion, InitializeParameter |
55-
| test.cpp:128:3:128:11 | ... = ... | |
56-
| test.cpp:139:3:139:24 | ... = ... | |
57-
| test.cpp:147:3:147:18 | ... = ... | |
58-
| test.cpp:156:3:156:17 | ... = ... | |

cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/Uniqueness.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cpp
2-
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
2+
import semmle.code.cpp.valuenumbering.GlobalValueNumberingImpl
33

44
// Every expression should have exactly one GVN.
55
// So this query should have zero results.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
| test.cpp:5:3:5:13 | ... = ... | test.cpp:5:3:5:13 | ... = ... | AST only |
2+
| test.cpp:6:3:6:13 | ... = ... | test.cpp:6:3:6:13 | ... = ... | AST only |
3+
| test.cpp:7:3:7:7 | ... = ... | test.cpp:7:3:7:7 | ... = ... | AST only |
4+
| test.cpp:10:16:10:16 | 1 | test.cpp:10:16:10:16 | 1 | AST only |
5+
| test.cpp:16:3:16:24 | ... = ... | test.cpp:16:3:16:24 | ... = ... | AST only |
6+
| test.cpp:17:3:17:24 | ... = ... | test.cpp:17:3:17:24 | ... = ... | AST only |
7+
| test.cpp:18:3:18:7 | ... = ... | test.cpp:18:3:18:7 | ... = ... | AST only |
8+
| test.cpp:21:16:21:16 | 2 | test.cpp:21:16:21:16 | 2 | AST only |
9+
| test.cpp:29:3:29:3 | x | test.cpp:31:3:31:3 | x | IR only |
10+
| test.cpp:29:3:29:24 | ... = ... | test.cpp:29:3:29:24 | ... = ... | AST only |
11+
| test.cpp:30:3:30:17 | call to change_global02 | test.cpp:30:3:30:17 | call to change_global02 | AST only |
12+
| test.cpp:31:3:31:3 | x | test.cpp:29:3:29:3 | x | IR only |
13+
| test.cpp:31:3:31:24 | ... = ... | test.cpp:31:3:31:24 | ... = ... | AST only |
14+
| test.cpp:32:3:32:7 | ... = ... | test.cpp:32:3:32:7 | ... = ... | AST only |
15+
| test.cpp:35:16:35:16 | 3 | test.cpp:35:16:35:16 | 3 | AST only |
16+
| test.cpp:43:3:43:3 | x | test.cpp:45:3:45:3 | x | IR only |
17+
| test.cpp:43:3:43:24 | ... = ... | test.cpp:43:3:43:24 | ... = ... | AST only |
18+
| test.cpp:43:7:43:24 | ... + ... | test.cpp:45:7:45:24 | ... + ... | IR only |
19+
| test.cpp:43:7:43:24 | ... + ... | test.cpp:46:7:46:7 | x | IR only |
20+
| test.cpp:43:17:43:24 | global03 | test.cpp:45:17:45:24 | global03 | IR only |
21+
| test.cpp:44:3:44:5 | * ... | test.cpp:44:4:44:5 | p2 | IR only |
22+
| test.cpp:44:3:44:9 | ... = ... | test.cpp:44:3:44:9 | ... = ... | AST only |
23+
| test.cpp:44:4:44:5 | p2 | test.cpp:44:3:44:5 | * ... | IR only |
24+
| test.cpp:44:9:44:9 | 0 | test.cpp:51:25:51:25 | 0 | AST only |
25+
| test.cpp:44:9:44:9 | 0 | test.cpp:53:18:53:21 | (int)... | AST only |
26+
| test.cpp:44:9:44:9 | 0 | test.cpp:56:39:56:42 | (int)... | AST only |
27+
| test.cpp:44:9:44:9 | 0 | test.cpp:59:17:59:20 | (int)... | AST only |
28+
| test.cpp:44:9:44:9 | 0 | test.cpp:88:12:88:12 | 0 | AST only |
29+
| test.cpp:45:3:45:3 | x | test.cpp:43:3:43:3 | x | IR only |
30+
| test.cpp:45:3:45:24 | ... = ... | test.cpp:45:3:45:24 | ... = ... | AST only |
31+
| test.cpp:45:7:45:24 | ... + ... | test.cpp:43:7:43:24 | ... + ... | IR only |
32+
| test.cpp:45:17:45:24 | global03 | test.cpp:43:17:43:24 | global03 | IR only |
33+
| test.cpp:46:3:46:7 | ... = ... | test.cpp:46:3:46:7 | ... = ... | AST only |
34+
| test.cpp:46:7:46:7 | x | test.cpp:43:7:43:24 | ... + ... | IR only |
35+
| test.cpp:51:25:51:25 | 0 | test.cpp:44:9:44:9 | 0 | AST only |
36+
| test.cpp:51:25:51:25 | 0 | test.cpp:53:18:53:21 | (int)... | AST only |
37+
| test.cpp:51:25:51:25 | 0 | test.cpp:56:39:56:42 | (int)... | AST only |
38+
| test.cpp:51:25:51:25 | 0 | test.cpp:59:17:59:20 | (int)... | AST only |
39+
| test.cpp:51:25:51:25 | 0 | test.cpp:88:12:88:12 | 0 | AST only |
40+
| test.cpp:51:25:51:25 | (unsigned int)... | test.cpp:51:25:51:25 | (unsigned int)... | AST only |
41+
| test.cpp:53:10:53:13 | (int)... | test.cpp:53:10:53:13 | (int)... | AST only |
42+
| test.cpp:53:10:53:13 | (int)... | test.cpp:56:21:56:24 | (int)... | AST only |
43+
| test.cpp:53:18:53:21 | (int)... | test.cpp:44:9:44:9 | 0 | AST only |
44+
| test.cpp:53:18:53:21 | (int)... | test.cpp:51:25:51:25 | 0 | AST only |
45+
| test.cpp:53:18:53:21 | (int)... | test.cpp:53:18:53:21 | (int)... | AST only |
46+
| test.cpp:53:18:53:21 | (int)... | test.cpp:56:39:56:42 | (int)... | AST only |
47+
| test.cpp:53:18:53:21 | (int)... | test.cpp:59:17:59:20 | (int)... | AST only |
48+
| test.cpp:53:18:53:21 | (int)... | test.cpp:88:12:88:12 | 0 | AST only |
49+
| test.cpp:55:5:55:15 | ... = ... | test.cpp:55:5:55:15 | ... = ... | AST only |
50+
| test.cpp:56:12:56:25 | (...) | test.cpp:56:12:56:25 | (...) | AST only |
51+
| test.cpp:56:12:56:43 | ... && ... | test.cpp:56:12:56:43 | ... && ... | AST only |
52+
| test.cpp:56:13:56:16 | (int)... | test.cpp:56:13:56:16 | (int)... | AST only |
53+
| test.cpp:56:13:56:16 | (int)... | test.cpp:56:31:56:34 | (int)... | AST only |
54+
| test.cpp:56:13:56:16 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
55+
| test.cpp:56:13:56:16 | * ... | test.cpp:56:31:56:34 | * ... | AST only |
56+
| test.cpp:56:13:56:16 | * ... | test.cpp:59:9:59:12 | * ... | AST only |
57+
| test.cpp:56:21:56:24 | (int)... | test.cpp:53:10:53:13 | (int)... | AST only |
58+
| test.cpp:56:21:56:24 | (int)... | test.cpp:56:21:56:24 | (int)... | AST only |
59+
| test.cpp:56:30:56:43 | (...) | test.cpp:56:30:56:43 | (...) | AST only |
60+
| test.cpp:56:31:56:34 | (int)... | test.cpp:56:13:56:16 | (int)... | AST only |
61+
| test.cpp:56:31:56:34 | (int)... | test.cpp:56:31:56:34 | (int)... | AST only |
62+
| test.cpp:56:31:56:34 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
63+
| test.cpp:56:31:56:34 | * ... | test.cpp:56:13:56:16 | * ... | AST only |
64+
| test.cpp:56:31:56:34 | * ... | test.cpp:59:9:59:12 | * ... | AST only |
65+
| test.cpp:56:39:56:42 | (int)... | test.cpp:44:9:44:9 | 0 | AST only |
66+
| test.cpp:56:39:56:42 | (int)... | test.cpp:51:25:51:25 | 0 | AST only |
67+
| test.cpp:56:39:56:42 | (int)... | test.cpp:53:18:53:21 | (int)... | AST only |
68+
| test.cpp:56:39:56:42 | (int)... | test.cpp:56:39:56:42 | (int)... | AST only |
69+
| test.cpp:56:39:56:42 | (int)... | test.cpp:59:17:59:20 | (int)... | AST only |
70+
| test.cpp:56:39:56:42 | (int)... | test.cpp:88:12:88:12 | 0 | AST only |
71+
| test.cpp:56:47:56:51 | ... ++ | test.cpp:56:47:56:51 | ... ++ | AST only |
72+
| test.cpp:59:9:59:12 | (int)... | test.cpp:56:13:56:16 | (int)... | AST only |
73+
| test.cpp:59:9:59:12 | (int)... | test.cpp:56:31:56:34 | (int)... | AST only |
74+
| test.cpp:59:9:59:12 | (int)... | test.cpp:59:9:59:12 | (int)... | AST only |
75+
| test.cpp:59:9:59:12 | * ... | test.cpp:56:13:56:16 | * ... | AST only |
76+
| test.cpp:59:9:59:12 | * ... | test.cpp:56:31:56:34 | * ... | AST only |
77+
| test.cpp:59:17:59:20 | (int)... | test.cpp:44:9:44:9 | 0 | AST only |
78+
| test.cpp:59:17:59:20 | (int)... | test.cpp:51:25:51:25 | 0 | AST only |
79+
| test.cpp:59:17:59:20 | (int)... | test.cpp:53:18:53:21 | (int)... | AST only |
80+
| test.cpp:59:17:59:20 | (int)... | test.cpp:56:39:56:42 | (int)... | AST only |
81+
| test.cpp:59:17:59:20 | (int)... | test.cpp:59:17:59:20 | (int)... | AST only |
82+
| test.cpp:59:17:59:20 | (int)... | test.cpp:88:12:88:12 | 0 | AST only |
83+
| test.cpp:62:5:62:12 | ... ++ | test.cpp:62:5:62:12 | ... ++ | AST only |
84+
| test.cpp:77:20:77:28 | call to getAValue | test.cpp:79:7:79:7 | v | IR only |
85+
| test.cpp:77:20:77:30 | (signed short)... | test.cpp:77:20:77:30 | (signed short)... | AST only |
86+
| test.cpp:77:20:77:30 | (signed short)... | test.cpp:79:7:79:7 | v | AST only |
87+
| test.cpp:79:7:79:7 | (int)... | test.cpp:79:7:79:7 | (int)... | AST only |
88+
| test.cpp:79:7:79:7 | v | test.cpp:77:20:77:28 | call to getAValue | IR only |
89+
| test.cpp:79:7:79:7 | v | test.cpp:77:20:77:30 | (signed short)... | AST only |
90+
| test.cpp:79:11:79:20 | (int)... | test.cpp:79:11:79:20 | (int)... | AST only |
91+
| test.cpp:79:24:79:33 | (int)... | test.cpp:79:24:79:33 | (int)... | AST only |
92+
| test.cpp:80:5:80:19 | ... = ... | test.cpp:80:5:80:19 | ... = ... | AST only |
93+
| test.cpp:80:9:80:19 | (signed short)... | test.cpp:80:9:80:19 | (signed short)... | AST only |
94+
| test.cpp:88:3:88:20 | ... = ... | test.cpp:88:3:88:20 | ... = ... | AST only |
95+
| test.cpp:88:12:88:12 | 0 | test.cpp:44:9:44:9 | 0 | AST only |
96+
| test.cpp:88:12:88:12 | 0 | test.cpp:51:25:51:25 | 0 | AST only |
97+
| test.cpp:88:12:88:12 | 0 | test.cpp:53:18:53:21 | (int)... | AST only |
98+
| test.cpp:88:12:88:12 | 0 | test.cpp:56:39:56:42 | (int)... | AST only |
99+
| test.cpp:88:12:88:12 | 0 | test.cpp:59:17:59:20 | (int)... | AST only |
100+
| test.cpp:88:12:88:12 | (void *)... | test.cpp:88:12:88:12 | (void *)... | AST only |
101+
| test.cpp:92:11:92:16 | ... = ... | test.cpp:92:15:92:16 | 10 | IR only |
102+
| test.cpp:92:11:92:16 | ... = ... | test.cpp:93:10:93:10 | x | IR only |
103+
| test.cpp:92:15:92:16 | 10 | test.cpp:92:11:92:16 | ... = ... | IR only |
104+
| test.cpp:92:15:92:16 | 10 | test.cpp:93:10:93:10 | x | IR only |
105+
| test.cpp:93:10:93:10 | x | test.cpp:92:11:92:16 | ... = ... | IR only |
106+
| test.cpp:93:10:93:10 | x | test.cpp:92:15:92:16 | 10 | IR only |
107+
| test.cpp:105:11:105:12 | (Base *)... | test.cpp:105:11:105:12 | (Base *)... | AST only |
108+
| test.cpp:105:11:105:12 | (Base *)... | test.cpp:106:14:106:35 | static_cast<Base *>... | AST only |
109+
| test.cpp:105:11:105:12 | (Base *)... | test.cpp:107:11:107:12 | pb | AST only |
110+
| test.cpp:105:11:105:12 | pd | test.cpp:107:11:107:12 | pb | IR only |
111+
| test.cpp:106:14:106:35 | static_cast<Base *>... | test.cpp:105:11:105:12 | (Base *)... | AST only |
112+
| test.cpp:106:14:106:35 | static_cast<Base *>... | test.cpp:106:14:106:35 | static_cast<Base *>... | AST only |
113+
| test.cpp:106:14:106:35 | static_cast<Base *>... | test.cpp:107:11:107:12 | pb | AST only |
114+
| test.cpp:106:33:106:34 | pd | test.cpp:107:11:107:12 | pb | IR only |
115+
| test.cpp:107:11:107:12 | pb | test.cpp:105:11:105:12 | (Base *)... | AST only |
116+
| test.cpp:107:11:107:12 | pb | test.cpp:105:11:105:12 | pd | IR only |
117+
| test.cpp:107:11:107:12 | pb | test.cpp:106:14:106:35 | static_cast<Base *>... | AST only |
118+
| test.cpp:107:11:107:12 | pb | test.cpp:106:33:106:34 | pd | IR only |
119+
| test.cpp:113:3:113:5 | a | test.cpp:115:3:115:5 | a | IR only |
120+
| test.cpp:115:3:115:5 | a | test.cpp:113:3:113:5 | a | IR only |
121+
| test.cpp:125:15:125:15 | x | test.cpp:128:7:128:7 | x | AST only |
122+
| test.cpp:126:15:126:15 | x | test.cpp:128:7:128:7 | x | AST only |
123+
| test.cpp:128:3:128:11 | ... = ... | test.cpp:128:3:128:11 | ... = ... | AST only |
124+
| test.cpp:128:7:128:7 | x | test.cpp:125:15:125:15 | x | AST only |
125+
| test.cpp:128:7:128:7 | x | test.cpp:126:15:126:15 | x | AST only |
126+
| test.cpp:128:11:128:11 | n | test.cpp:129:15:129:15 | x | IR only |
127+
| test.cpp:129:15:129:15 | x | test.cpp:128:11:128:11 | n | IR only |
128+
| test.cpp:136:21:136:21 | x | test.cpp:137:21:137:21 | x | AST only |
129+
| test.cpp:136:21:136:21 | x | test.cpp:139:13:139:13 | x | AST only |
130+
| test.cpp:137:21:137:21 | x | test.cpp:136:21:136:21 | x | AST only |
131+
| test.cpp:137:21:137:21 | x | test.cpp:139:13:139:13 | x | AST only |
132+
| test.cpp:139:3:139:24 | ... = ... | test.cpp:139:3:139:24 | ... = ... | AST only |
133+
| test.cpp:139:13:139:13 | x | test.cpp:136:21:136:21 | x | AST only |
134+
| test.cpp:139:13:139:13 | x | test.cpp:137:21:137:21 | x | AST only |
135+
| test.cpp:144:15:144:15 | x | test.cpp:149:15:149:15 | x | IR only |
136+
| test.cpp:145:15:145:15 | y | test.cpp:147:7:147:7 | y | AST only |
137+
| test.cpp:147:3:147:18 | ... = ... | test.cpp:147:3:147:18 | ... = ... | AST only |
138+
| test.cpp:147:7:147:7 | y | test.cpp:145:15:145:15 | y | AST only |
139+
| test.cpp:149:15:149:15 | x | test.cpp:144:15:144:15 | x | IR only |
140+
| test.cpp:153:21:153:21 | x | test.cpp:154:21:154:21 | x | AST only |
141+
| test.cpp:154:21:154:21 | x | test.cpp:153:21:153:21 | x | AST only |
142+
| test.cpp:156:3:156:17 | ... = ... | test.cpp:156:3:156:17 | ... = ... | AST only |

cpp/ql/test/library-tests/valuenumbering/GlobalValueNumbering/diff_ir_expr.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cpp
2-
import semmle.code.cpp.valuenumbering.GlobalValueNumbering as AST
2+
import semmle.code.cpp.valuenumbering.GlobalValueNumberingImpl as AST
33
import semmle.code.cpp.ir.internal.ASTValueNumbering as IR
44
import semmle.code.cpp.ir.IR
55

0 commit comments

Comments
 (0)