Skip to content

Commit 404bc5c

Browse files
hau-hsuvitalybuka
authored andcommitted
[Asan] Loose call stack CHECK conditions
These test cases are checking specific functions in call stacks. But if the call stack order is changed (e.g. another function is not inlined), the frame number would be different. This patch loose the frame number checks for those conditions. Depends on D139827 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D152991
1 parent 7f25a88 commit 404bc5c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler-rt/test/asan/TestCases/Linux/syscalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ int main(int argc, char *argv[]) {
1717
__sanitizer_syscall_pre_recvmsg(0, buf - 1, 0);
1818
// CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow
1919
// CHECK: READ of size {{.*}} at {{.*}} thread T0
20-
// CHECK: #0 {{.*}} in __sanitizer_syscall{{.*}}recvmsg
20+
// CHECK: {{#[0-9]+ .*}} in __sanitizer_syscall{{.*}}recvmsg
2121
return 0;
2222
}

compiler-rt/test/asan/TestCases/Posix/bcmp_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(int argc, char **argv) {
1212
char a2[] = {1, static_cast<char>(2 * argc), 3, 4};
1313
int res = bcmp(a1, a2, 4 + argc); // BOOM
1414
// CHECK: AddressSanitizer: stack-buffer-overflow
15-
// CHECK: {{#1.*bcmp}}
16-
// CHECK: {{#2.*main}}
15+
// CHECK: {{#[0-9]+ .*bcmp}}
16+
// CHECK: {{#[0-9]+ .*main}}
1717
return res;
1818
}

compiler-rt/test/asan/TestCases/memcmp_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main(int argc, char **argv) {
1111
char a2[] = {1, static_cast<char>(2*argc), 3, 4};
1212
int res = memcmp(a1, a2, 4 + argc); // BOOM
1313
// CHECK: AddressSanitizer: stack-buffer-overflow
14-
// CHECK: {{#1.*memcmp}}
15-
// CHECK: {{#2.*main}}
14+
// CHECK: {{#[0-9]+ .*memcmp}}
15+
// CHECK: {{#[0-9]+ .*main}}
1616
return res;
1717
}

0 commit comments

Comments
 (0)