Skip to content

Commit 07a0b4d

Browse files
committed
C++: update test expaectations
1 parent 5f77552 commit 07a0b4d

File tree

4 files changed

+60
-117
lines changed

4 files changed

+60
-117
lines changed

cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ postWithInFlow
220220
| lambdas.cpp:20:11:20:11 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |
221221
| lambdas.cpp:20:11:20:11 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |
222222
| lambdas.cpp:20:11:20:11 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |
223-
| lambdas.cpp:23:3:23:3 | (reference dereference) [post update] | PostUpdateNode should not be the target of local flow. |
224223
| lambdas.cpp:23:3:23:14 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |
225224
| lambdas.cpp:23:3:23:14 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
226225
| lambdas.cpp:23:3:23:14 | v [post update] | PostUpdateNode should not be the target of local flow. |
226+
| lambdas.cpp:23:15:23:15 | (reference dereference) [post update] | PostUpdateNode should not be the target of local flow. |
227227
| lambdas.cpp:28:7:28:7 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
228228
| lambdas.cpp:28:10:31:2 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |
229229
| lambdas.cpp:28:10:31:2 | FieldAddress [post update] | PostUpdateNode should not be the target of local flow. |

cpp/ql/test/library-tests/ir/ir/PrintAST.expected

Lines changed: 45 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -13565,22 +13565,22 @@ ir.cpp:
1356513565
# 1757| Type = [IntType] int
1356613566
# 1757| getEntryPoint(): [BlockStmt] { ... }
1356713567
# 1758| getStmt(0): [IfStmt] if (...) ...
13568-
# 1758| getInitialization(): [DeclStmt] declaration
13569-
# 1758| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y
13570-
# 1758| Type = [IntType] int
13571-
# 1758| getVariable().getInitializer(): [Initializer] initializer for y
13572-
# 1758| getExpr(): [VariableAccess] x
13573-
# 1758| Type = [IntType] int
13574-
# 1758| ValueCategory = prvalue(load)
13575-
# 1758| getCondition(): [AddExpr] ... + ...
13576-
# 1758| Type = [IntType] int
13568+
# 1758| getCondition(): [ConditionDeclExpr] (condition decl)
13569+
# 1758| Type = [BoolType] bool
1357713570
# 1758| ValueCategory = prvalue
13578-
# 1758| getLeftOperand(): [VariableAccess] x
13571+
# 1758| getChild(0): [AddExpr] ... + ...
1357913572
# 1758| Type = [IntType] int
13580-
# 1758| ValueCategory = prvalue(load)
13581-
# 1758| getRightOperand(): [Literal] 1
13582-
# 1758| Type = [IntType] int
13583-
# 1758| Value = [Literal] 1
13573+
# 1758| ValueCategory = prvalue
13574+
# 1758| getLeftOperand(): [VariableAccess] x
13575+
# 1758| Type = [IntType] int
13576+
# 1758| ValueCategory = prvalue(load)
13577+
# 1758| getRightOperand(): [Literal] 1
13578+
# 1758| Type = [IntType] int
13579+
# 1758| Value = [Literal] 1
13580+
# 1758| ValueCategory = prvalue
13581+
# 1758| getChild(0).getFullyConverted(): [CStyleCast] (bool)...
13582+
# 1758| Conversion = [BoolConversion] conversion to bool
13583+
# 1758| Type = [BoolType] bool
1358413584
# 1758| ValueCategory = prvalue
1358513585
# 1758| getThen(): [BlockStmt] { ... }
1358613586
# 1759| getStmt(0): [ExprStmt] ExprStmt
@@ -13599,33 +13599,26 @@ ir.cpp:
1359913599
# 1759| getRightOperand(): [VariableAccess] y
1360013600
# 1759| Type = [IntType] int
1360113601
# 1759| ValueCategory = prvalue(load)
13602-
# 1758| getCondition().getFullyConverted(): [CStyleCast] (bool)...
13603-
# 1758| Conversion = [BoolConversion] conversion to bool
13604-
# 1758| Type = [BoolType] bool
13605-
# 1758| ValueCategory = prvalue
1360613602
# 1762| getStmt(1): [DeclStmt] declaration
1360713603
# 1762| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
1360813604
# 1762| Type = [IntType] int
1360913605
# 1763| getStmt(2): [IfStmt] if (...) ...
13610-
# 1763| getInitialization(): [ExprStmt] ExprStmt
13611-
# 1763| getExpr(): [AssignExpr] ... = ...
13606+
# 1763| getCondition(): [ConditionDeclExpr] (condition decl)
13607+
# 1763| Type = [BoolType] bool
13608+
# 1763| ValueCategory = prvalue
13609+
# 1763| getChild(0): [AddExpr] ... + ...
1361213610
# 1763| Type = [IntType] int
13613-
# 1763| ValueCategory = lvalue
13614-
# 1763| getLValue(): [VariableAccess] w
13615-
# 1763| Type = [IntType] int
13616-
# 1763| ValueCategory = lvalue
13617-
# 1763| getRValue(): [VariableAccess] x
13611+
# 1763| ValueCategory = prvalue
13612+
# 1763| getLeftOperand(): [VariableAccess] x
1361813613
# 1763| Type = [IntType] int
1361913614
# 1763| ValueCategory = prvalue(load)
13620-
# 1763| getCondition(): [AddExpr] ... + ...
13621-
# 1763| Type = [IntType] int
13622-
# 1763| ValueCategory = prvalue
13623-
# 1763| getLeftOperand(): [VariableAccess] x
13624-
# 1763| Type = [IntType] int
13625-
# 1763| ValueCategory = prvalue(load)
13626-
# 1763| getRightOperand(): [Literal] 1
13627-
# 1763| Type = [IntType] int
13628-
# 1763| Value = [Literal] 1
13615+
# 1763| getRightOperand(): [Literal] 1
13616+
# 1763| Type = [IntType] int
13617+
# 1763| Value = [Literal] 1
13618+
# 1763| ValueCategory = prvalue
13619+
# 1763| getChild(0).getFullyConverted(): [CStyleCast] (bool)...
13620+
# 1763| Conversion = [BoolConversion] conversion to bool
13621+
# 1763| Type = [BoolType] bool
1362913622
# 1763| ValueCategory = prvalue
1363013623
# 1763| getThen(): [BlockStmt] { ... }
1363113624
# 1764| getStmt(0): [ExprStmt] ExprStmt
@@ -13644,21 +13637,7 @@ ir.cpp:
1364413637
# 1764| getRightOperand(): [VariableAccess] w
1364513638
# 1764| Type = [IntType] int
1364613639
# 1764| ValueCategory = prvalue(load)
13647-
# 1763| getCondition().getFullyConverted(): [CStyleCast] (bool)...
13648-
# 1763| Conversion = [BoolConversion] conversion to bool
13649-
# 1763| Type = [BoolType] bool
13650-
# 1763| ValueCategory = prvalue
1365113640
# 1767| getStmt(3): [IfStmt] if (...) ...
13652-
# 1767| getInitialization(): [ExprStmt] ExprStmt
13653-
# 1767| getExpr(): [AssignExpr] ... = ...
13654-
# 1767| Type = [IntType] int
13655-
# 1767| ValueCategory = lvalue
13656-
# 1767| getLValue(): [VariableAccess] w
13657-
# 1767| Type = [IntType] int
13658-
# 1767| ValueCategory = lvalue
13659-
# 1767| getRValue(): [VariableAccess] x
13660-
# 1767| Type = [IntType] int
13661-
# 1767| ValueCategory = prvalue(load)
1366213641
# 1767| getCondition(): [ConditionDeclExpr] (condition decl)
1366313642
# 1767| Type = [BoolType] bool
1366413643
# 1767| ValueCategory = prvalue
@@ -13687,13 +13666,6 @@ ir.cpp:
1368713666
# 1768| Type = [IntType] int
1368813667
# 1768| ValueCategory = prvalue(load)
1368913668
# 1771| getStmt(4): [IfStmt] if (...) ...
13690-
# 1771| getInitialization(): [DeclStmt] declaration
13691-
# 1771| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
13692-
# 1771| Type = [IntType] int
13693-
# 1771| getVariable().getInitializer(): [Initializer] initializer for v
13694-
# 1771| getExpr(): [VariableAccess] x
13695-
# 1771| Type = [IntType] int
13696-
# 1771| ValueCategory = prvalue(load)
1369713669
# 1771| getCondition(): [ConditionDeclExpr] (condition decl)
1369813670
# 1771| Type = [BoolType] bool
1369913671
# 1771| ValueCategory = prvalue
@@ -13782,23 +13754,19 @@ ir.cpp:
1378213754
# 1785| Type = [IntType] int
1378313755
# 1785| getEntryPoint(): [BlockStmt] { ... }
1378413756
# 1786| getStmt(0): [SwitchStmt] switch (...) ...
13785-
# 1786| getInitialization(): [DeclStmt] declaration
13786-
# 1786| getDeclarationEntry(0): [VariableDeclarationEntry] definition of y
13787-
# 1786| Type = [IntType] int
13788-
# 1786| getVariable().getInitializer(): [Initializer] initializer for y
13789-
# 1786| getExpr(): [VariableAccess] x
13790-
# 1786| Type = [IntType] int
13791-
# 1786| ValueCategory = prvalue(load)
13792-
# 1786| getExpr(): [AddExpr] ... + ...
13757+
# 1786| getExpr(): [ConditionDeclExpr] (condition decl)
1379313758
# 1786| Type = [IntType] int
1379413759
# 1786| ValueCategory = prvalue
13795-
# 1786| getLeftOperand(): [VariableAccess] x
13760+
# 1786| getChild(0): [AddExpr] ... + ...
1379613761
# 1786| Type = [IntType] int
13797-
# 1786| ValueCategory = prvalue(load)
13798-
# 1786| getRightOperand(): [Literal] 1
13799-
# 1786| Type = [IntType] int
13800-
# 1786| Value = [Literal] 1
1380113762
# 1786| ValueCategory = prvalue
13763+
# 1786| getLeftOperand(): [VariableAccess] x
13764+
# 1786| Type = [IntType] int
13765+
# 1786| ValueCategory = prvalue(load)
13766+
# 1786| getRightOperand(): [Literal] 1
13767+
# 1786| Type = [IntType] int
13768+
# 1786| Value = [Literal] 1
13769+
# 1786| ValueCategory = prvalue
1380213770
# 1786| getStmt(): [BlockStmt] { ... }
1380313771
# 1787| getStmt(0): [SwitchCase] default:
1380413772
# 1788| getStmt(1): [ExprStmt] ExprStmt
@@ -13821,26 +13789,19 @@ ir.cpp:
1382113789
# 1791| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
1382213790
# 1791| Type = [IntType] int
1382313791
# 1792| getStmt(2): [SwitchStmt] switch (...) ...
13824-
# 1792| getInitialization(): [ExprStmt] ExprStmt
13825-
# 1792| getExpr(): [AssignExpr] ... = ...
13826-
# 1792| Type = [IntType] int
13827-
# 1792| ValueCategory = lvalue
13828-
# 1792| getLValue(): [VariableAccess] w
13829-
# 1792| Type = [IntType] int
13830-
# 1792| ValueCategory = lvalue
13831-
# 1792| getRValue(): [VariableAccess] x
13832-
# 1792| Type = [IntType] int
13833-
# 1792| ValueCategory = prvalue(load)
13834-
# 1792| getExpr(): [AddExpr] ... + ...
13792+
# 1792| getExpr(): [ConditionDeclExpr] (condition decl)
1383513793
# 1792| Type = [IntType] int
1383613794
# 1792| ValueCategory = prvalue
13837-
# 1792| getLeftOperand(): [VariableAccess] x
13838-
# 1792| Type = [IntType] int
13839-
# 1792| ValueCategory = prvalue(load)
13840-
# 1792| getRightOperand(): [Literal] 1
13795+
# 1792| getChild(0): [AddExpr] ... + ...
1384113796
# 1792| Type = [IntType] int
13842-
# 1792| Value = [Literal] 1
1384313797
# 1792| ValueCategory = prvalue
13798+
# 1792| getLeftOperand(): [VariableAccess] x
13799+
# 1792| Type = [IntType] int
13800+
# 1792| ValueCategory = prvalue(load)
13801+
# 1792| getRightOperand(): [Literal] 1
13802+
# 1792| Type = [IntType] int
13803+
# 1792| Value = [Literal] 1
13804+
# 1792| ValueCategory = prvalue
1384413805
# 1792| getStmt(): [BlockStmt] { ... }
1384513806
# 1793| getStmt(0): [SwitchCase] default:
1384613807
# 1794| getStmt(1): [ExprStmt] ExprStmt
@@ -13860,16 +13821,6 @@ ir.cpp:
1386013821
# 1794| Type = [IntType] int
1386113822
# 1794| ValueCategory = prvalue(load)
1386213823
# 1797| getStmt(3): [SwitchStmt] switch (...) ...
13863-
# 1797| getInitialization(): [ExprStmt] ExprStmt
13864-
# 1797| getExpr(): [AssignExpr] ... = ...
13865-
# 1797| Type = [IntType] int
13866-
# 1797| ValueCategory = lvalue
13867-
# 1797| getLValue(): [VariableAccess] w
13868-
# 1797| Type = [IntType] int
13869-
# 1797| ValueCategory = lvalue
13870-
# 1797| getRValue(): [VariableAccess] x
13871-
# 1797| Type = [IntType] int
13872-
# 1797| ValueCategory = prvalue(load)
1387313824
# 1797| getExpr(): [ConditionDeclExpr] (condition decl)
1387413825
# 1797| Type = [IntType] int
1387513826
# 1797| ValueCategory = prvalue
@@ -13895,13 +13846,6 @@ ir.cpp:
1389513846
# 1799| Type = [IntType] int
1389613847
# 1799| ValueCategory = prvalue(load)
1389713848
# 1802| getStmt(4): [SwitchStmt] switch (...) ...
13898-
# 1802| getInitialization(): [DeclStmt] declaration
13899-
# 1802| getDeclarationEntry(0): [VariableDeclarationEntry] definition of v
13900-
# 1802| Type = [IntType] int
13901-
# 1802| getVariable().getInitializer(): [Initializer] initializer for v
13902-
# 1802| getExpr(): [VariableAccess] x
13903-
# 1802| Type = [IntType] int
13904-
# 1802| ValueCategory = prvalue(load)
1390513849
# 1802| getExpr(): [ConditionDeclExpr] (condition decl)
1390613850
# 1802| Type = [IntType] int
1390713851
# 1802| ValueCategory = prvalue

cpp/ql/test/library-tests/ir/ir/raw_ir.expected

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9432,6 +9432,13 @@ ir.cpp:
94329432
# 1750| v1750_7(void) = ExitFunction :
94339433

94349434
# 1757| void if_initialization(int)
9435+
# 1757| Block 0
9436+
# 1757| v1757_1(void) = EnterFunction :
9437+
# 1757| mu1757_2(unknown) = AliasedDefinition :
9438+
# 1757| mu1757_3(unknown) = InitializeNonLocal :
9439+
# 1757| r1757_4(glval<int>) = VariableAddress[x] :
9440+
# 1757| mu1757_5(int) = InitializeParameter[x] : &:r1757_4
9441+
94359442
# 1758| (no string representation)
94369443
# 1758| CopyValue: (condition decl)
94379444
# 1758| ConditionalBranch: (condition decl)
@@ -9444,13 +9451,6 @@ ir.cpp:
94449451
#-----| False -> Block 6
94459452
#-----| True -> Block 5
94469453

9447-
# 1757| Block 0
9448-
# 1757| v1757_1(void) = EnterFunction :
9449-
# 1757| mu1757_2(unknown) = AliasedDefinition :
9450-
# 1757| mu1757_3(unknown) = InitializeNonLocal :
9451-
# 1757| r1757_4(glval<int>) = VariableAddress[x] :
9452-
# 1757| mu1757_5(int) = InitializeParameter[x] : &:r1757_4
9453-
94549454
# 1758| Block 1
94559455
# 1758| r1758_1(glval<int>) = VariableAddress[x] :
94569456
# 1758| r1758_2(int) = Load[x] : &:r1758_1, ~m?
@@ -9592,6 +9592,13 @@ ir.cpp:
95929592
# 1757| v1757_8(void) = ExitFunction :
95939593

95949594
# 1785| void switch_initialization(int)
9595+
# 1785| Block 0
9596+
# 1785| v1785_1(void) = EnterFunction :
9597+
# 1785| mu1785_2(unknown) = AliasedDefinition :
9598+
# 1785| mu1785_3(unknown) = InitializeNonLocal :
9599+
# 1785| r1785_4(glval<int>) = VariableAddress[x] :
9600+
# 1785| mu1785_5(int) = InitializeParameter[x] : &:r1785_4
9601+
95959602
# 1786| (no string representation)
95969603
# 1786| CopyValue: (condition decl)
95979604
# 1786| Switch: switch (...) ...
@@ -9602,13 +9609,6 @@ ir.cpp:
96029609
# 1792| Switch: switch (...) ...
96039610
#-----| Default -> Block 4
96049611

9605-
# 1785| Block 0
9606-
# 1785| v1785_1(void) = EnterFunction :
9607-
# 1785| mu1785_2(unknown) = AliasedDefinition :
9608-
# 1785| mu1785_3(unknown) = InitializeNonLocal :
9609-
# 1785| r1785_4(glval<int>) = VariableAddress[x] :
9610-
# 1785| mu1785_5(int) = InitializeParameter[x] : &:r1785_4
9611-
96129612
# 1786| Block 1
96139613
# 1786| r1786_1(glval<int>) = VariableAddress[x] :
96149614
# 1786| r1786_2(int) = Load[x] : &:r1786_1, ~m?

cpp/ql/test/library-tests/syntax-zoo/dataflow-ir-consistency.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,6 @@ postWithInFlow
16221622
| cpp11.cpp:28:21:28:34 | temporary object [post update] | PostUpdateNode should not be the target of local flow. |
16231623
| cpp11.cpp:29:7:29:16 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
16241624
| cpp11.cpp:31:5:31:13 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
1625-
| cpp11.cpp:35:11:35:22 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
16261625
| cpp11.cpp:36:5:36:14 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
16271626
| cpp11.cpp:56:14:56:15 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
16281627
| cpp11.cpp:56:14:56:15 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |

0 commit comments

Comments
 (0)