Skip to content

Commit 9ceb967

Browse files
authored
Reland "[Utils] add update-verify-tests.py" (#108630)" (#108658)
This relands commit d4f41be which was reverted by b7e585b. This version ignores differences in line endings in the diff tests to make sure the tests work as intended on Windows. Original description below: Adds a python script to automatically take output from a failed clang -verify test and update the test case(s) to expect the new behaviour.
1 parent 7836603 commit 9ceb967

36 files changed

+699
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
void foo() {
2+
// expected-error@+1{{use of undeclared identifier 'a'}}
3+
a = 2; a = 2;
4+
b = 2; b = 2;
5+
// expected-error@+1 3{{use of undeclared identifier 'c'}}
6+
c = 2; c = 2;
7+
// expected-error 2{{asdf}}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
void foo() {
2+
// expected-error@+1 2{{use of undeclared identifier 'a'}}
3+
a = 2; a = 2;
4+
// expected-error@+1 2{{use of undeclared identifier 'b'}}
5+
b = 2; b = 2;
6+
// expected-error@+1 2{{use of undeclared identifier 'c'}}
7+
c = 2; c = 2;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
void foo() {
2+
// expected-error@+1 2 {{use of undeclared identifier 'a'}}
3+
a = 2; a = 2; b = 2; b = 2; c = 2;
4+
// expected-error@+1 2 {{asdf}}
5+
d = 2;
6+
e = 2; f = 2; // expected-error 2 {{use of undeclared identifier 'e'}}
7+
}
8+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
void foo() {
2+
// expected-error@+3 {{use of undeclared identifier 'c'}}
3+
// expected-error@+2 2 {{use of undeclared identifier 'b'}}
4+
// expected-error@+1 2 {{use of undeclared identifier 'a'}}
5+
a = 2; a = 2; b = 2; b = 2; c = 2;
6+
// expected-error@+1 {{use of undeclared identifier 'd'}}
7+
d = 2;
8+
// expected-error@+1 {{use of undeclared identifier 'f'}}
9+
e = 2; f = 2; // expected-error {{use of undeclared identifier 'e'}}
10+
}
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
void foo() {
2+
a = 2;
3+
// expected-error@-1{{use of undeclared identifier 'a'}}
4+
b = 2;// expected-error{{use of undeclared identifier 'b'}}
5+
c = 2;
6+
// expected-error@5{{use of undeclared identifier 'c'}}
7+
d = 2; // expected-error-re{{use of {{.*}} identifier 'd'}}
8+
9+
e = 2; // error to trigger mismatch
10+
}
11+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void foo() {
2+
a = 2;
3+
// expected-error@-1{{use of undeclared identifier 'a'}}
4+
b = 2;// expected-error{{use of undeclared identifier 'b'}}
5+
c = 2;
6+
// expected-error@5{{use of undeclared identifier 'c'}}
7+
d = 2; // expected-error-re{{use of {{.*}} identifier 'd'}}
8+
9+
// expected-error@+1{{use of undeclared identifier 'e'}}
10+
e = 2; // error to trigger mismatch
11+
}
12+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
void foo() {
2+
a = 2;
3+
b = 2;
4+
5+
c = 2;
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
void foo() {
2+
// expected-error@+1{{use of undeclared identifier 'a'}}
3+
a = 2;
4+
// expected-error@+1{{use of undeclared identifier 'b'}}
5+
b = 2;
6+
7+
// expected-error@+1{{use of undeclared identifier 'c'}}
8+
c = 2;
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
void foo() {
2+
a = 2; b = 2; c = 2;
3+
}
4+
5+
void bar() {
6+
x = 2; y = 2; z = 2;
7+
// expected-error@-1{{use of undeclared identifier 'x'}}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void foo() {
2+
// expected-error@+3{{use of undeclared identifier 'c'}}
3+
// expected-error@+2{{use of undeclared identifier 'b'}}
4+
// expected-error@+1{{use of undeclared identifier 'a'}}
5+
a = 2; b = 2; c = 2;
6+
}
7+
8+
void bar() {
9+
x = 2; y = 2; z = 2;
10+
// expected-error@-1{{use of undeclared identifier 'x'}}
11+
// expected-error@-2{{use of undeclared identifier 'y'}}
12+
// expected-error@-3{{use of undeclared identifier 'z'}}
13+
}

0 commit comments

Comments
 (0)