Skip to content

Commit c90d0fa

Browse files
committed
C++: Fix ODR violations in dataflow tests
1 parent f1e2268 commit c90d0fa

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int* deref(int** p) { // $ ast-def=p ir-def=*p ir-def=**p
7878
return q;
7979
}
8080

81-
void test1() {
81+
void flowout_test1() {
8282
int x = 0;
8383
int* p = &x;
8484
deref(&p)[0] = source();
@@ -95,7 +95,7 @@ void addtaint2(int** p) { // $ ast-def=p ir-def=*p ir-def=**p
9595
addtaint1(q);
9696
}
9797

98-
void test2() {
98+
void flowout_test2() {
9999
int x = 0;
100100
int* p = &x;
101101
addtaint2(&p);

cpp/ql/test/library-tests/dataflow/dataflow-tests/self-Iterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ template<> struct std::iterator_traits<unsigned long>
1515
};
1616

1717

18-
int test() {
18+
int iterator_test() {
1919
unsigned long x = source();
2020
sink(x); // $ ast ir
2121
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ int source();
55
void sink(...);
66
bool random();
77

8-
void test1() {
8+
void on_entry_test1() {
99
int x = source();
1010
for (int i = 0; i < 10; i++) {
1111
x = 0;
1212
}
1313
sink(x); // $ SPURIOUS: ir
1414
}
1515

16-
void test2(int iterations) {
16+
void on_entry_test2(int iterations) {
1717
int x = source();
1818
for (int i = 0; i < iterations; i++) {
1919
x = 0;
2020
}
2121
sink(x); // $ ast,ir
2222
}
2323

24-
void test3() {
24+
void on_entry_test3() {
2525
int x = 0;
2626
for (int i = 0; i < 10; i++) {
2727
x = source();
2828
}
2929
sink(x); // $ ast,ir
3030
}
3131

32-
void test4() {
32+
void on_entry_test4() {
3333
int x = source();
3434
for (int i = 0; i < 10; i++) {
3535
if (random())
@@ -39,7 +39,7 @@ void test4() {
3939
sink(x); // $ ast,ir
4040
}
4141

42-
void test5() {
42+
void on_entry_test5() {
4343
int x = source();
4444
for (int i = 0; i < 10; i++) {
4545
if (random())
@@ -49,15 +49,15 @@ void test5() {
4949
sink(x); // $ ast,ir
5050
}
5151

52-
void test6() {
52+
void on_entry_test6() {
5353
int y;
5454
int x = source();
5555
for (int i = 0; i < 10 && (y = 1); i++) {
5656
}
5757
sink(x); // $ ast,ir
5858
}
5959

60-
void test7() {
60+
void on_entry_test7() {
6161
int y;
6262
int x = source();
6363
for (int i = 0; i < 10 && (y = 1); i++) {
@@ -66,7 +66,7 @@ void test7() {
6666
sink(x); // $ SPURIOUS: ir
6767
}
6868

69-
void test8() {
69+
void on_entry_test8() {
7070
int x = source();
7171
// It appears to the analysis that the condition can exit after `i < 10`
7272
// without having assigned to `x`. That is an effect of how the
@@ -78,22 +78,22 @@ void test8() {
7878
sink(x); // $ SPURIOUS: ast,ir
7979
}
8080

81-
void test9() {
81+
void on_entry_test9() {
8282
int y;
8383
int x = source();
8484
for (int i = 0; (y = 1) && i < 10; i++) {
8585
}
8686
sink(x); // $ ast,ir
8787
}
8888

89-
void test10() {
89+
void on_entry_test10() {
9090
int x = source();
9191
for (int i = 0; (x = 1) && i < 10; i++) {
9292
}
9393
sink(x); // no flow
9494
}
9595

96-
void test10(int b, int d) {
96+
void on_entry_test10(int b, int d) {
9797
int i = 0;
9898
int x = source();
9999
if (b)

0 commit comments

Comments
 (0)