Skip to content

Commit 0b8403f

Browse files
committed
C++: Add one more test.
1 parent b4e45ad commit 0b8403f

File tree

7 files changed

+18
-0
lines changed

7 files changed

+18
-0
lines changed

cpp/ql/test/library-tests/defuse/definition.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:60:10:60:11 | 2 |
8282
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:61:34:61:35 | & ... |
8383
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:66:12:66:18 | 0 |
84+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:74:10:74:11 | 2 |
85+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:75:35:75:36 | & ... |
8486
| test.cpp:4:7:4:7 | a | test.cpp:5:3:5:8 | ... = ... |
8587
| test.cpp:4:7:4:7 | a | test.cpp:13:3:13:7 | ... = ... |
8688
| test.cpp:4:7:4:7 | a | test.cpp:19:5:19:9 | ... = ... |

cpp/ql/test/library-tests/defuse/definitionUsePair.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:61:34:61:35 | & ... | pass_by_ref.cpp:62:10:62:10 | x |
8080
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:66:12:66:18 | 0 | pass_by_ref.cpp:67:34:67:34 | p |
8181
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:66:12:66:18 | 0 | pass_by_ref.cpp:68:10:68:10 | p |
82+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:74:10:74:11 | 2 | pass_by_ref.cpp:75:36:75:36 | x |
83+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:75:35:75:36 | & ... | pass_by_ref.cpp:76:10:76:10 | x |
8284
| test.cpp:4:7:4:7 | a | test.cpp:5:3:5:8 | ... = ... | test.cpp:9:7:9:7 | a |
8385
| test.cpp:4:7:4:7 | a | test.cpp:13:3:13:7 | ... = ... | test.cpp:14:7:14:7 | a |
8486
| test.cpp:4:7:4:7 | a | test.cpp:13:3:13:7 | ... = ... | test.cpp:18:7:18:7 | a |

cpp/ql/test/library-tests/defuse/exprDefinition.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
| pass_by_ref.cpp:46:7:46:7 | i | pass_by_ref.cpp:46:11:46:11 | n | pass_by_ref.cpp:46:11:46:11 | n |
2020
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:60:10:60:11 | 2 | pass_by_ref.cpp:60:10:60:11 | 2 |
2121
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:66:12:66:18 | 0 | pass_by_ref.cpp:66:12:66:18 | 0 |
22+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:74:10:74:11 | 2 | pass_by_ref.cpp:74:10:74:11 | 2 |
2223
| test.cpp:4:7:4:7 | a | test.cpp:5:3:5:8 | ... = ... | test.cpp:5:7:5:8 | a0 |
2324
| test.cpp:4:7:4:7 | a | test.cpp:13:3:13:7 | ... = ... | test.cpp:13:7:13:7 | b |
2425
| test.cpp:4:7:4:7 | a | test.cpp:19:5:19:9 | ... = ... | test.cpp:19:9:19:9 | 1 |

cpp/ql/test/library-tests/defuse/isAddressOfAccess.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@
155155
| pass_by_ref.cpp:62:10:62:10 | x | |
156156
| pass_by_ref.cpp:67:34:67:34 | p | const address |
157157
| pass_by_ref.cpp:68:10:68:10 | p | |
158+
| pass_by_ref.cpp:75:36:75:36 | x | non-const address |
159+
| pass_by_ref.cpp:76:10:76:10 | x | |
158160
| test.cpp:5:3:5:3 | a | |
159161
| test.cpp:5:7:5:8 | a0 | |
160162
| test.cpp:6:3:6:3 | b | |

cpp/ql/test/library-tests/defuse/pass_by_ref.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ int * noTemporaryObject() {
6767
constPointerReferenceParameter(p);
6868
return p;
6969
}
70+
71+
void pointerRvalueReferenceParameter(int * && pRef);
72+
73+
int temporaryObject2() {
74+
int x = 2;
75+
pointerRvalueReferenceParameter(&x);
76+
return x;
77+
}

cpp/ql/test/library-tests/defuse/useOfVar.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:62:10:62:10 | x |
123123
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:67:34:67:34 | p |
124124
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:68:10:68:10 | p |
125+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:75:36:75:36 | x |
126+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:76:10:76:10 | x |
125127
| test.cpp:3:16:3:17 | a0 | test.cpp:5:7:5:8 | a0 |
126128
| test.cpp:3:24:3:25 | b0 | test.cpp:6:7:6:8 | b0 |
127129
| test.cpp:3:32:3:33 | c0 | test.cpp:7:7:7:8 | c0 |

cpp/ql/test/library-tests/defuse/useOfVarActual.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
| pass_by_ref.cpp:46:7:46:7 | i | pass_by_ref.cpp:54:10:54:10 | i |
5959
| pass_by_ref.cpp:60:7:60:7 | x | pass_by_ref.cpp:62:10:62:10 | x |
6060
| pass_by_ref.cpp:66:8:66:8 | p | pass_by_ref.cpp:68:10:68:10 | p |
61+
| pass_by_ref.cpp:74:7:74:7 | x | pass_by_ref.cpp:76:10:76:10 | x |
6162
| test.cpp:3:16:3:17 | a0 | test.cpp:5:7:5:8 | a0 |
6263
| test.cpp:3:24:3:25 | b0 | test.cpp:6:7:6:8 | b0 |
6364
| test.cpp:3:32:3:33 | c0 | test.cpp:7:7:7:8 | c0 |

0 commit comments

Comments
 (0)