Skip to content

Commit e7e517b

Browse files
committed
C++: Accept more updated test output
1 parent d508826 commit e7e517b

8 files changed

+476
-198
lines changed

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

Lines changed: 101 additions & 45 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| getCondition(): [ConditionDeclExpr] (condition decl)
13569-
# 1758| Type = [BoolType] bool
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
1357013577
# 1758| ValueCategory = prvalue
13571-
# 1758| getChild(0): [AddExpr] ... + ...
13578+
# 1758| getLeftOperand(): [VariableAccess] x
1357213579
# 1758| Type = [IntType] int
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
13580+
# 1758| ValueCategory = prvalue(load)
13581+
# 1758| getRightOperand(): [Literal] 1
13582+
# 1758| Type = [IntType] int
13583+
# 1758| Value = [Literal] 1
1358413584
# 1758| ValueCategory = prvalue
1358513585
# 1758| getThen(): [BlockStmt] { ... }
1358613586
# 1759| getStmt(0): [ExprStmt] ExprStmt
@@ -13599,26 +13599,33 @@ 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
1360213606
# 1762| getStmt(1): [DeclStmt] declaration
1360313607
# 1762| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
1360413608
# 1762| Type = [IntType] int
1360513609
# 1763| getStmt(2): [IfStmt] if (...) ...
13606-
# 1763| getCondition(): [ConditionDeclExpr] (condition decl)
13607-
# 1763| Type = [BoolType] bool
13608-
# 1763| ValueCategory = prvalue
13609-
# 1763| getChild(0): [AddExpr] ... + ...
13610+
# 1763| getInitialization(): [ExprStmt] ExprStmt
13611+
# 1763| getExpr(): [AssignExpr] ... = ...
1361013612
# 1763| Type = [IntType] int
13611-
# 1763| ValueCategory = prvalue
13612-
# 1763| getLeftOperand(): [VariableAccess] x
13613+
# 1763| ValueCategory = lvalue
13614+
# 1763| getLValue(): [VariableAccess] w
1361313615
# 1763| Type = [IntType] int
13614-
# 1763| ValueCategory = prvalue(load)
13615-
# 1763| getRightOperand(): [Literal] 1
13616+
# 1763| ValueCategory = lvalue
13617+
# 1763| getRValue(): [VariableAccess] x
1361613618
# 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
13619+
# 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
1362213629
# 1763| ValueCategory = prvalue
1362313630
# 1763| getThen(): [BlockStmt] { ... }
1362413631
# 1764| getStmt(0): [ExprStmt] ExprStmt
@@ -13637,7 +13644,21 @@ ir.cpp:
1363713644
# 1764| getRightOperand(): [VariableAccess] w
1363813645
# 1764| Type = [IntType] int
1363913646
# 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
1364013651
# 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)
1364113662
# 1767| getCondition(): [ConditionDeclExpr] (condition decl)
1364213663
# 1767| Type = [BoolType] bool
1364313664
# 1767| ValueCategory = prvalue
@@ -13666,6 +13687,13 @@ ir.cpp:
1366613687
# 1768| Type = [IntType] int
1366713688
# 1768| ValueCategory = prvalue(load)
1366813689
# 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)
1366913697
# 1771| getCondition(): [ConditionDeclExpr] (condition decl)
1367013698
# 1771| Type = [BoolType] bool
1367113699
# 1771| ValueCategory = prvalue
@@ -13754,19 +13782,23 @@ ir.cpp:
1375413782
# 1785| Type = [IntType] int
1375513783
# 1785| getEntryPoint(): [BlockStmt] { ... }
1375613784
# 1786| getStmt(0): [SwitchStmt] switch (...) ...
13757-
# 1786| getExpr(): [ConditionDeclExpr] (condition decl)
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] ... + ...
1375813793
# 1786| Type = [IntType] int
1375913794
# 1786| ValueCategory = prvalue
13760-
# 1786| getChild(0): [AddExpr] ... + ...
13795+
# 1786| getLeftOperand(): [VariableAccess] x
1376113796
# 1786| Type = [IntType] int
13797+
# 1786| ValueCategory = prvalue(load)
13798+
# 1786| getRightOperand(): [Literal] 1
13799+
# 1786| Type = [IntType] int
13800+
# 1786| Value = [Literal] 1
1376213801
# 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
1377013802
# 1786| getStmt(): [BlockStmt] { ... }
1377113803
# 1787| getStmt(0): [SwitchCase] default:
1377213804
# 1788| getStmt(1): [ExprStmt] ExprStmt
@@ -13789,19 +13821,26 @@ ir.cpp:
1378913821
# 1791| getDeclarationEntry(0): [VariableDeclarationEntry] definition of w
1379013822
# 1791| Type = [IntType] int
1379113823
# 1792| getStmt(2): [SwitchStmt] switch (...) ...
13792-
# 1792| getExpr(): [ConditionDeclExpr] (condition decl)
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] ... + ...
1379313835
# 1792| Type = [IntType] int
1379413836
# 1792| ValueCategory = prvalue
13795-
# 1792| getChild(0): [AddExpr] ... + ...
13837+
# 1792| getLeftOperand(): [VariableAccess] x
13838+
# 1792| Type = [IntType] int
13839+
# 1792| ValueCategory = prvalue(load)
13840+
# 1792| getRightOperand(): [Literal] 1
1379613841
# 1792| Type = [IntType] int
13842+
# 1792| Value = [Literal] 1
1379713843
# 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
1380513844
# 1792| getStmt(): [BlockStmt] { ... }
1380613845
# 1793| getStmt(0): [SwitchCase] default:
1380713846
# 1794| getStmt(1): [ExprStmt] ExprStmt
@@ -13821,6 +13860,16 @@ ir.cpp:
1382113860
# 1794| Type = [IntType] int
1382213861
# 1794| ValueCategory = prvalue(load)
1382313862
# 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)
1382413873
# 1797| getExpr(): [ConditionDeclExpr] (condition decl)
1382513874
# 1797| Type = [IntType] int
1382613875
# 1797| ValueCategory = prvalue
@@ -13846,6 +13895,13 @@ ir.cpp:
1384613895
# 1799| Type = [IntType] int
1384713896
# 1799| ValueCategory = prvalue(load)
1384813897
# 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)
1384913905
# 1802| getExpr(): [ConditionDeclExpr] (condition decl)
1385013906
# 1802| Type = [IntType] int
1385113907
# 1802| ValueCategory = prvalue

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| ir.cpp:1757:28:1757:28 | InitializeParameter: x | Instruction 'InitializeParameter: x' has no successors in function '$@'. | ir.cpp:1757:6:1757:22 | void if_initialization(int) | void if_initialization(int) |
10-
| ir.cpp:1785:32:1785:32 | InitializeParameter: x | Instruction 'InitializeParameter: x' has no successors in function '$@'. | ir.cpp:1785:6:1785:26 | void switch_initialization(int) | void switch_initialization(int) |
119
ambiguousSuccessors
1210
unexplainedLoop
1311
unnecessaryPhiInstruction

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9-
| ir.cpp:1757:28:1757:28 | InitializeParameter: x | Instruction 'InitializeParameter: x' has no successors in function '$@'. | ir.cpp:1757:6:1757:22 | void if_initialization(int) | void if_initialization(int) |
10-
| ir.cpp:1785:32:1785:32 | InitializeParameter: x | Instruction 'InitializeParameter: x' has no successors in function '$@'. | ir.cpp:1785:6:1785:26 | void switch_initialization(int) | void switch_initialization(int) |
119
ambiguousSuccessors
1210
unexplainedLoop
1311
unnecessaryPhiInstruction

0 commit comments

Comments
 (0)