Skip to content

Commit 6663420

Browse files
committed
C++: test for multiple for loop variables with destructors
1 parent b94c4a6 commit 6663420

10 files changed

+1033
-763
lines changed

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

Lines changed: 272 additions & 189 deletions
Large diffs are not rendered by default.

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

Lines changed: 267 additions & 209 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9+
| ir.cpp:2161:28:2161:29 | Chi: s2 | Instruction 'Chi: s2' has no successors in function '$@'. | ir.cpp:2151:6:2151:19 | void ForDestructors() | void ForDestructors() |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9+
| ir.cpp:2161:28:2161:29 | Chi: s2 | Instruction 'Chi: s2' has no successors in function '$@'. | ir.cpp:2151:6:2151:19 | void ForDestructors() | void ForDestructors() |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,6 +2157,10 @@ void ForDestructors() {
21572157
for(String s : vector<String>(String("hello"))) {
21582158
String s2;
21592159
}
2160+
2161+
for(String s("hello"), s2("world"); c != 0; c = s.pop_back()) {
2162+
c = 0;
2163+
}
21602164
}
21612165

21622166
void IfDestructors2(bool b) {

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

Lines changed: 254 additions & 193 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9+
| ir.cpp:2161:28:2161:29 | IndirectMayWriteSideEffect: s2 | Instruction 'IndirectMayWriteSideEffect: s2' has no successors in function '$@'. | ir.cpp:2151:6:2151:19 | void ForDestructors() | void ForDestructors() |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 231 additions & 172 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9+
| ir.cpp:2161:28:2161:29 | IndirectMayWriteSideEffect: s2 | Instruction 'IndirectMayWriteSideEffect: s2' has no successors in function '$@'. | ir.cpp:2151:6:2151:19 | void ForDestructors() | void ForDestructors() |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ missingOperandType
66
duplicateChiOperand
77
sideEffectWithoutPrimary
88
instructionWithoutSuccessor
9+
| ir.cpp:2161:28:2161:29 | IndirectMayWriteSideEffect: s2 | Instruction 'IndirectMayWriteSideEffect: s2' has no successors in function '$@'. | ir.cpp:2151:6:2151:19 | void ForDestructors() | void ForDestructors() |
910
ambiguousSuccessors
1011
unexplainedLoop
1112
unnecessaryPhiInstruction

0 commit comments

Comments
 (0)