Skip to content

Commit ea2d3fc

Browse files
committed
C++: Accept changes in constant_func test
1 parent dea0704 commit ea2d3fc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ int UnreachableViaGoto() {
3838
return 0;
3939
}
4040

41+
/*
42+
The unaliased IR uses the raw IR's dead code elimination and constant
43+
analysis, so it isn't able to tell that the `return 1`s are dead code,
44+
and thus doesn't know that this always returns the same value.
45+
*/
4146
int UnreachableIf(bool b) {
4247
int x = 5;
4348
int y = 10;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
| constant_func.cpp:5:5:5:21 | IR: ReturnConstantPhi | 7 |
33
| constant_func.cpp:25:5:25:25 | IR: ReturnConstantPhiLoop | 7 |
44
| constant_func.cpp:34:5:34:22 | IR: UnreachableViaGoto | 0 |
5-
| constant_func.cpp:41:5:41:17 | IR: UnreachableIf | 0 |
6-
| constant_func.cpp:62:5:62:16 | IR: DoWhileFalse | 1 |
5+
| constant_func.cpp:67:5:67:16 | IR: DoWhileFalse | 1 |

0 commit comments

Comments
 (0)