Skip to content

Commit eea02e1

Browse files
committed
C++: Accept test changes.
1 parent a39a6ea commit eea02e1

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ void following_pointers( // $ ast-def=sourceStruct1_ptr
4848

4949
int stackArray[2] = { source(), source() };
5050
stackArray[0] = source();
51-
sink(stackArray); // $ ast ir ir=49:7 ir=49:25 ir=49:35 ir=50:19
51+
sink(stackArray); // $ ast ir ir=49:25 ir=49:35 ir=50:19
5252
}

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,17 @@ void intPointerSourceCaller() {
423423
intPointerSource(&local);
424424
sink(local); // $ ast,ir=422:7 ast,ir=423:20
425425
}
426-
// The IR results for this test _are_ equivalent to the AST ones.
427-
// The IR annotation is just "ir" because the sink of the unitialized source at
428-
// `433:7` (i.e., the declaration `int local[1];`) is value of `local`, but the sink
429-
// of the source from `intPointerSource` value of `*local` (i.e., the indirection node
430-
// of `local`). So unlike AST dataflow, each of these two sinks correspond to a unique
431-
// source, and thus we don't need to attach a location annotation to it.
426+
427+
428+
429+
430+
431+
432432
void intPointerSourceCaller2() {
433433
int local[1];
434434
intPointerSource(local);
435-
sink(local); // $ ast=433:7 ast=434:20 ir=433:7 ir=434:20 ir
436-
sink(*local); // $ ast=433:7 ast=434:20 ir=433:7 ir=434:20
435+
sink(local); // $ ast=434:20 ir SPURIOUS: ast=433:7
436+
sink(*local); // $ ast=434:20 ir SPURIOUS: ast=433:7
437437
}
438438

439439
void intArraySourceCaller() {
@@ -447,8 +447,8 @@ void intArraySourceCaller() {
447447
void intArraySourceCaller2() {
448448
int local[2];
449449
intArraySource(local, 2);
450-
sink(local); // $ ast=448:7 ast=449:18 ir=448:7 ir=449:18 ir
451-
sink(*local); // $ ast=448:7 ast=449:18 ir=448:7 ir=449:18
450+
sink(local); // $ ast=449:18 ir SPURIOUS: ast=448:7
451+
sink(*local); // $ ast=449:18 ir SPURIOUS: ast=448:7
452452
}
453453

454454
///////////////////////////////////////////////////////////////////////////////
@@ -518,7 +518,7 @@ void uncertain_definition() {
518518
int clean = 0;
519519
stackArray[0] = source();
520520
stackArray[1] = clean;
521-
sink(stackArray[0]); // $ ast=519:19 ir=517:7 ir=519:19 SPURIOUS: ast=517:7
521+
sink(stackArray[0]); // $ ast=519:19 ir SPURIOUS: ast=517:7
522522
}
523523

524524
void set_through_const_pointer(int x, const int **e) // $ ast-def=e ir-def=**e ir-def=*e
@@ -594,7 +594,7 @@ void test_indirect_flow_to_array() {
594594
int* p = indirect_source();
595595
int* xs[2];
596596
xs[0] = p;
597-
sink(*xs[0]); // $ ir=594:12 MISSING: ast SPURIOUS: ir=595:8
597+
sink(*xs[0]); // $ ir MISSING: ast
598598
}
599599

600600
void test_def_by_ref_followed_by_uncertain_write_array(int* p) { // $ ast-def=p ir-def=*p

0 commit comments

Comments
 (0)