Skip to content

Commit da924ef

Browse files
authored
Merge pull request #19970 from jketema/incr
C++: Add test showing we miss the operands of postfix crement in dataflow
2 parents 5649073 + 5b26a42 commit da924ef

File tree

1 file changed

+10
-1
lines changed
  • cpp/ql/test/library-tests/dataflow/asExpr

1 file changed

+10
-1
lines changed

cpp/ql/test/library-tests/dataflow/asExpr/test.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,13 @@ void test_aggregate_literal() {
3737

3838
int xs[] = {1, 2, 3}; // $ asExpr=1 asExpr=2 asExpr=3 asExpr={...}
3939
const int ys[] = {[0] = 4, [1] = 5, [0] = 6}; // $ asExpr=4 asExpr=5 asExpr=6 asExpr={...}
40-
}
40+
}
41+
42+
void test_postfix_crement(int *p, int q) {
43+
p++; // $ asExpr="... ++" asIndirectExpr="... ++" asExpr=p asIndirectExpr=p
44+
q++; // $ asExpr="... ++" asExpr=q
45+
(void)(p++); // $ numberOfNodes="... ++: 2" asExpr="... ++" numberOfIndirectNodes="... ++: 2" asIndirectExpr="... ++" MISSING: asExpr=p asIndirectExpr=p
46+
(void)(q++); // $ numberOfNodes="... ++: 2" asExpr="... ++" MISSING: asExpr=q
47+
int *p1 = p++; // $ asExpr="... ++" asIndirectExpr="... ++" asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
48+
int q1 = q++; // $ asExpr="... ++" asExpr="q(... ++)"
49+
}

0 commit comments

Comments
 (0)