[ASan] Remove leading underscores from function names in output tests

llvm-svn: 185315
This commit is contained in:
Alexey Samsonov 2013-07-01 08:41:45 +00:00
parent 8918140809
commit cc510707af
16 changed files with 31 additions and 31 deletions

View File

@ -14,7 +14,7 @@ int main(int argc, char **argv) {
memset(x, 0, 10); memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*zero-base-shadow32.cc:}}[[@LINE-2]] // CHECK: {{ #0 0x.* in main .*zero-base-shadow32.cc:}}[[@LINE-2]]
// CHECK: {{Address 0x.* is .* frame}} // CHECK: {{Address 0x.* is .* frame}}
// CHECK: main // CHECK: main

View File

@ -14,7 +14,7 @@ int main(int argc, char **argv) {
memset(x, 0, 10); memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*zero-base-shadow64.cc:}}[[@LINE-2]] // CHECK: {{ #0 0x.* in main .*zero-base-shadow64.cc:}}[[@LINE-2]]
// CHECK: {{Address 0x.* is .* frame}} // CHECK: {{Address 0x.* is .* frame}}
// CHECK: main // CHECK: main

View File

@ -13,7 +13,7 @@ int main(int argc, char **argv) {
memset(ZZZ, 0, 10); memset(ZZZ, 0, 10);
int res = YYY[argc * 10]; // BOOOM int res = YYY[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*global-overflow.cc:}}[[@LINE-2]] // CHECK: {{ #0 0x.* in main .*global-overflow.cc:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of global variable}} // CHECK: {{0x.* is located 0 bytes to the right of global variable}}
// CHECK: {{.*YYY.* of size 10}} // CHECK: {{.*YYY.* of size 10}}
res += XXX[argc] + ZZZ[argc]; res += XXX[argc] + ZZZ[argc];

View File

@ -14,15 +14,15 @@ int main(int argc, char **argv) {
memset(x, 0, 10); memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*heap-overflow.cc:}}[[@LINE-2]] // CHECK: {{ #0 0x.* in main .*heap-overflow.cc:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}} // CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
// CHECK: {{allocated by thread T0 here:}} // CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #0 0x.* in .*malloc}}
// CHECK-Linux: {{ #1 0x.* in main .*heap-overflow.cc:13}} // CHECK-Linux: {{ #1 0x.* in main .*heap-overflow.cc:13}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*heap-overflow.cc:13}} // CHECK-Darwin: {{ #1 0x.* in main .*heap-overflow.cc:13}}
free(x); free(x);
return res; return res;
} }

View File

@ -17,7 +17,7 @@ int main(int argc, char **argv) {
int res = ioctl(fd, FIONBIO, &nonblock + 1); int res = ioctl(fd, FIONBIO, &nonblock + 1);
// CHECK: AddressSanitizer: stack-buffer-overflow // CHECK: AddressSanitizer: stack-buffer-overflow
// CHECK: READ of size 4 at // CHECK: READ of size 4 at
// CHECK: {{#.* in _?main .*ioctl.cc:}}[[@LINE-3]] // CHECK: {{#.* in main .*ioctl.cc:}}[[@LINE-3]]
assert(res == 0); assert(res == 0);
close(fd); close(fd);
return 0; return 0;

View File

@ -45,11 +45,11 @@ static void LargeFunction(int *x, int zero) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
int *x = new int[100]; int *x = new int[100];
LargeFunction(x, argc - 1); LargeFunction(x, argc - 1);
// CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-1]] // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-1]]
// CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}} // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}}
// CHECK: {{allocated by thread T0 here:}} // CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in operator new.*}} // CHECK-Linux: {{ #0 0x.* in operator new.*}}
// CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}} // CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}}
// CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-7]] // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-7]]
delete x; delete x;
} }

View File

@ -19,5 +19,5 @@ static void NullDeref(int *ptr) {
} }
int main() { int main() {
NullDeref((int*)0); NullDeref((int*)0);
// CHECK: {{ #1 0x.* in _?main.*null_deref.cc:}}[[@LINE-1]] // CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]]
} }

View File

@ -37,6 +37,6 @@ int main(int argc, char *argv[]) {
// CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}} // CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}}
// CHECK: {{READ of size 4 at 0x.* thread T0}} // CHECK: {{READ of size 4 at 0x.* thread T0}}
// CHECK: {{ #0 0x.*}} // CHECK: {{ #0 0x.*}}
// CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:}}[[@LINE-4]] // CHECK: {{ #1 0x.* in main .*shared-lib-test.cc:}}[[@LINE-4]]
return 0; return 0;
} }

View File

@ -9,7 +9,7 @@ int main(int argc, char **argv) {
memset(x, 0, 10); memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]] // CHECK: {{ #0 0x.* in main .*stack-overflow.cc:}}[[@LINE-2]]
// CHECK: {{Address 0x.* is located in stack of thread T0 at offset}} // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}}
// CHECK-NEXT: in{{.*}}main{{.*}}stack-overflow.cc // CHECK-NEXT: in{{.*}}main{{.*}}stack-overflow.cc
return res; return res;

View File

@ -16,15 +16,15 @@ int main(int argc, char **argv) {
strncpy(short_buffer, hello, 10); // BOOM strncpy(short_buffer, hello, 10); // BOOM
// CHECK: {{WRITE of size 10 at 0x.* thread T0}} // CHECK: {{WRITE of size 10 at 0x.* thread T0}}
// CHECK-Linux: {{ #0 0x.* in .*strncpy}} // CHECK-Linux: {{ #0 0x.* in .*strncpy}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_strncpy}} // CHECK-Darwin: {{ #0 0x.* in wrap_strncpy}}
// CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-4]] // CHECK: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-4]]
// CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}} // CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
// CHECK: {{allocated by thread T0 here:}} // CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #0 0x.* in .*malloc}}
// CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]] // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]]
// CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-13]] // CHECK-Darwin: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-13]]
return short_buffer[8]; return short_buffer[8];
} }

View File

@ -18,21 +18,21 @@ int main() {
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK: {{WRITE of size 1 at 0x.* thread T0}} // CHECK: {{WRITE of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*use-after-free-right.cc:17}} // CHECK: {{ #0 0x.* in main .*use-after-free-right.cc:17}}
// CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}} // CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}} // CHECK: {{freed by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*free}} // CHECK-Linux: {{ #0 0x.* in .*free}}
// CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:16}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:16}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_free}} // CHECK-Darwin: {{ #0 0x.* in wrap_free}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:16}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:16}}
// CHECK: {{previously allocated by thread T0 here:}} // CHECK: {{previously allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #0 0x.* in .*malloc}}
// CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:15}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:15}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:15}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:15}}
} }

View File

@ -15,21 +15,21 @@ int main() {
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{ #0 0x.* in _?main .*use-after-free.cc:14}} // CHECK: {{ #0 0x.* in main .*use-after-free.cc:14}}
// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}} // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}} // CHECK: {{freed by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*free}} // CHECK-Linux: {{ #0 0x.* in .*free}}
// CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:13}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:13}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_free}} // CHECK-Darwin: {{ #0 0x.* in wrap_free}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:13}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:13}}
// CHECK: {{previously allocated by thread T0 here:}} // CHECK: {{previously allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #0 0x.* in .*malloc}}
// CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:12}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:12}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
// CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:12}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:12}}
} }

View File

@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
return arr[argc - 1]; // BOOM return arr[argc - 1]; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
// CHECK: READ of size 4 at 0x{{.*}} thread T0 // CHECK: READ of size 4 at 0x{{.*}} thread T0
// CHECK: #0 0x{{.*}} in {{_?}}main // CHECK: #0 0x{{.*}} in main
// CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]] // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]]
// CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset // CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset
// CHECK: [[OFFSET:[^ ]*]] in frame // CHECK: [[OFFSET:[^ ]*]] in frame

View File

@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
save(IntHolder(10)); save(IntHolder(10));
int x = saved->val; // BOOM int x = saved->val; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
// CHECK: #0 0x{{.*}} in {{_?}}main {{.*}}use-after-scope-temp.cc:[[@LINE-2]] // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
printf("saved value: %d\n", x); printf("saved value: %d\n", x);
return 0; return 0;
} }

View File

@ -9,7 +9,7 @@ int main() {
} }
return *p; // BOOM return *p; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
// CHECK: #0 0x{{.*}} in {{_?}}main {{.*}}use-after-scope.cc:[[@LINE-2]] // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cc:[[@LINE-2]]
// CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
// {{\[}}[[OFFSET]], {{[0-9]+}}) 'x' // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
} }

View File

@ -53,9 +53,9 @@ int main(int argc, char **argv) {
// CHECK: stack-buffer-overflow // CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}} // CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*wait}} // CHECK: {{in .*wait}}
// CHECK: {{in _?main .*wait.cc:}} // CHECK: {{in main .*wait.cc:}}
// CHECK: is located in stack of thread T0 at offset // CHECK: is located in stack of thread T0 at offset
// CHECK: {{in _?main}} // CHECK: {{in main}}
return res != -1; return res != -1;
} }
// child // child