diff options
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/asan/TestCases/wcscat.cpp | 10 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/wcscpy.cpp | 10 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/wcsncat.cpp | 10 | ||||
-rw-r--r-- | compiler-rt/test/asan/TestCases/wcsncpy.cpp | 11 |
4 files changed, 20 insertions, 21 deletions
diff --git a/compiler-rt/test/asan/TestCases/wcscat.cpp b/compiler-rt/test/asan/TestCases/wcscat.cpp index f0a8ec1..fd0b5a4 100644 --- a/compiler-rt/test/asan/TestCases/wcscat.cpp +++ b/compiler-rt/test/asan/TestCases/wcscat.cpp @@ -16,11 +16,11 @@ int main() { wchar_t badDst[9]; wcscpy(badDst, start); fprintf(stderr, "Good so far.\n"); - // CHECK: Good so far. + // CHECK-DAG: Good so far. fflush(stderr); wcscat(badDst, append); // Boom! - // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} - // CHECK: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 - // CHECK: #0 {{0x[0-9a-f]+}} in wcscat + // CHECK-DAG: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} + // CHECK-DAG: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 + // CHECK-DAG: #0 {{0x[0-9a-f]+}} in wcscat printf("Should have failed with ASAN error.\n"); -}
\ No newline at end of file +} diff --git a/compiler-rt/test/asan/TestCases/wcscpy.cpp b/compiler-rt/test/asan/TestCases/wcscpy.cpp index a280d29..8133a58 100644 --- a/compiler-rt/test/asan/TestCases/wcscpy.cpp +++ b/compiler-rt/test/asan/TestCases/wcscpy.cpp @@ -13,11 +13,11 @@ int main() { wchar_t badDst[7]; fprintf(stderr, "Good so far.\n"); - // CHECK: Good so far. + // CHECK-DAG: Good so far. fflush(stderr); wcscpy(badDst, src); // Boom! - // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} - // CHECK: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 - // CHECK: #0 {{0x[0-9a-f]+}} in wcscpy + // CHECK-DAG: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} + // CHECK-DAG: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 + // CHECK-DAG: #0 {{0x[0-9a-f]+}} in wcscpy printf("Should have failed with ASAN error.\n"); -}
\ No newline at end of file +} diff --git a/compiler-rt/test/asan/TestCases/wcsncat.cpp b/compiler-rt/test/asan/TestCases/wcsncat.cpp index eb7d095..365e732 100644 --- a/compiler-rt/test/asan/TestCases/wcsncat.cpp +++ b/compiler-rt/test/asan/TestCases/wcsncat.cpp @@ -17,11 +17,11 @@ int main() { wcscpy(badDst, start); wcsncat(badDst, append, 1); fprintf(stderr, "Good so far.\n"); - // CHECK: Good so far. + // CHECK-DAG: Good so far. fflush(stderr); wcsncat(badDst, append, 3); // Boom! - // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} - // CHECK: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 - // CHECK: #0 {{0x[0-9a-f]+}} in wcsncat + // CHECK-DAG: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} + // CHECK-DAG: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 + // CHECK-DAG: #0 {{0x[0-9a-f]+}} in wcsncat printf("Should have failed with ASAN error.\n"); -}
\ No newline at end of file +} diff --git a/compiler-rt/test/asan/TestCases/wcsncpy.cpp b/compiler-rt/test/asan/TestCases/wcsncpy.cpp index 1106bf5..485ddc4 100644 --- a/compiler-rt/test/asan/TestCases/wcsncpy.cpp +++ b/compiler-rt/test/asan/TestCases/wcsncpy.cpp @@ -14,12 +14,11 @@ int main() { wchar_t badDst[7]; wcsncpy(badDst, src, 7); // This should still work. fprintf(stderr, "Good so far.\n"); - // CHECK: Good so far. + // CHECK-DAG: Good so far. fflush(stderr); - wcsncpy(badDst, src, 15); // Boom! - // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} - // CHECK: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 - // CHECK: #0 {{0x[0-9a-f]+}} in wcsncpy + // CHECK-DAG: ERROR: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] at pc {{0x[0-9a-f]+}} bp {{0x[0-9a-f]+}} sp {{0x[0-9a-f]+}} + // CHECK-DAG: WRITE of size {{[0-9]+}} at [[ADDR]] thread T0 + // CHECK-DAG: #0 {{0x[0-9a-f]+}} in wcsncpy printf("Should have failed with ASAN error.\n"); -}
\ No newline at end of file +} |