Skip to content

Commit badfa1a

Browse files
committed
C++: Inline expectation should have space after $
This was a regex-find-replace from `// \$(?! )` (using a negative lookahead) to `// $ `.
1 parent b475f14 commit badfa1a

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class A
4646
{
4747
C *c = new C();
4848
B *b = B::make(c);
49-
sink(b->c); // $ast,ir
49+
sink(b->c); // $ ast,ir
5050
}
5151

5252
void f2()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class C
2626

2727
void func()
2828
{
29-
sink(s1); // $ast,ir
29+
sink(s1); // $ ast,ir
3030
sink(s2); // $ MISSING: ast,ir
31-
sink(s3); // $ast,ir
31+
sink(s3); // $ ast,ir
3232
sink(s4); // $ MISSING: ast,ir
3333
}
3434
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class D {
1919
};
2020

2121
static void sinkWrap(Box2* b2) {
22-
sink(b2->getBox1()->getElem()); // $ast,ir=28:15 ast,ir=35:15 ast,ir=42:15 ast,ir=49:15
22+
sink(b2->getBox1()->getElem()); // $ ast,ir=28:15 ast,ir=35:15 ast,ir=42:15 ast,ir=49:15
2323
}
2424

2525
Box2* boxfield;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ struct S {
4848
void test_setDirectly() {
4949
S s;
5050
s.setDirectly(user_input());
51-
sink(s.getDirectly()); // $ast ir
51+
sink(s.getDirectly()); // $ ast ir
5252
}
5353

5454
void test_setIndirectly() {
5555
S s;
5656
s.setIndirectly(user_input());
57-
sink(s.getIndirectly()); // $ast ir
57+
sink(s.getIndirectly()); // $ ast ir
5858
}
5959

6060
void test_setThroughNonMember() {
6161
S s;
6262
s.setThroughNonMember(user_input());
63-
sink(s.getThroughNonMember()); // $ast ir
63+
sink(s.getThroughNonMember()); // $ ast ir
6464
}
6565

6666
void test_nonMemberSetA() {
6767
S s;
6868
nonMemberSetA(&s, user_input());
69-
sink(nonMemberGetA(&s)); // $ast,ir
69+
sink(nonMemberGetA(&s)); // $ ast,ir
7070
}
7171

7272
////////////////////
@@ -112,7 +112,7 @@ void test_outer_with_ptr(Outer *pouter) {
112112
sink(outer.a); // $ ast,ir
113113

114114
sink(pouter->inner_nested.a); // $ ast,ir
115-
sink(pouter->inner_ptr->a); // $ast,ir
115+
sink(pouter->inner_ptr->a); // $ ast,ir
116116
sink(pouter->a); // $ ast,ir
117117
}
118118

cpp/ql/test/library-tests/ir/range-analysis/SimpleRangeAnalysis_tests.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int test4() {
4646
}
4747
range(total); // $ MISSING: range=>=0
4848
range(i); // $ range===2
49-
range(total + i); // $ range="<=Phi: i+2" MISSING: range===i+2 range=>=2 range=>=i+0
49+
range(total + i); // $ range="<=Phi: i+2" MISSING: range===i+2 range=>=2 range=>=i+0
5050
return total + i;
5151
}
5252

@@ -210,15 +210,15 @@ int test14(int x) {
210210
int x3 = (int)(unsigned int)x;
211211
range(x3);
212212
char c0 = x;
213-
range(c0);
213+
range(c0);
214214
unsigned short s0 = x;
215215
range(s0);
216216
range(x0 + x1 + x2 + x3 + c0 + s0); // $ overflow=+ overflow=+-
217217
return x0 + x1 + x2 + x3 + c0 + s0; // $ overflow=+ overflow=+-
218218
}
219219

220220
long long test15(long long x) {
221-
return (x > 0 && (range(x), x == (int)x)) ? // $ range=>=1
221+
return (x > 0 && (range(x), x == (int)x)) ? // $ range=>=1
222222
(range(x), x) : // $ range=>=1
223223
(range(x), -1);
224224
}
@@ -228,7 +228,7 @@ int test_unary(int a) {
228228
int total = 0;
229229

230230
if (3 <= a && a <= 11) {
231-
range(a); // $ range=<=11 range=>=3
231+
range(a); // $ range=<=11 range=>=3
232232
int b = +a;
233233
range(b); // $ range=<=11 range=>=3
234234
int c = -a;
@@ -384,7 +384,7 @@ int test_mult02(int a, int b) {
384384
total += r;
385385
range(total); // $ range=">=Phi: 0-143" range=">=Phi: 0-286"
386386
}
387-
range(total); // $range=">=Phi: 0-143" range=">=Phi: 0-286"
387+
range(total); // $ range=">=Phi: 0-143" range=">=Phi: 0-286"
388388
return total;
389389
}
390390

@@ -467,7 +467,7 @@ int test_mult04(int a, int b) {
467467
range(a); // $ range=<=0 range=>=-17
468468
range(b); // $ range=<=0 range=>=-13
469469
int r = a*b; // 0 .. 221
470-
range(r); // $ range=<=221 range=>=0
470+
range(r); // $ range=<=221 range=>=0
471471
total += r;
472472
range(total); // $ range="<=Phi: - ...+221"
473473
}
@@ -1030,7 +1030,7 @@ void test_negate_signed(int s) {
10301030
}
10311031
}
10321032

1033-
// By setting the guard after the use in another guard we
1033+
// By setting the guard after the use in another guard we
10341034
// don't get the useful information
10351035
void test_guard_after_use(int pos, int size, int offset) {
10361036
if (pos + offset >= size) { // $ overflow=+-
@@ -1040,12 +1040,12 @@ void test_guard_after_use(int pos, int size, int offset) {
10401040
return;
10411041
}
10421042
range(pos + 1); // $ overflow=+ range="==InitializeParameter: pos+1" MISSING: range="<=InitializeParameter: size-1"
1043-
}
1043+
}
10441044

10451045
int cond();
10461046

10471047

1048-
// This is basically what we get when we have a loop that calls
1048+
// This is basically what we get when we have a loop that calls
10491049
// realloc in some iterations
10501050
void alloc_in_loop(int origLen) {
10511051
if (origLen <= 10) {
@@ -1066,12 +1066,12 @@ void alloc_in_loop(int origLen) {
10661066
}
10671067
}
10681068

1069-
// This came from a case where it handled the leftovers before an unrolled loop
1069+
// This came from a case where it handled the leftovers before an unrolled loop
10701070
void mask_at_start(int len) {
10711071
if (len < 0) {
10721072
return;
10731073
}
1074-
int leftOver = len & 63;
1074+
int leftOver = len & 63;
10751075
for (int i = 0; i < leftOver; i++) {
10761076
range(i); // $ range=<=62 range=>=0 range="<=Store: ... & ... | Store: leftOver-1" range="<=InitializeParameter: len-1"
10771077
}

0 commit comments

Comments
 (0)