aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/lit_tests/TestCases/strdup_oob_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asan/lit_tests/TestCases/strdup_oob_test.cc')
-rw-r--r--lib/asan/lit_tests/TestCases/strdup_oob_test.cc19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/asan/lit_tests/TestCases/strdup_oob_test.cc b/lib/asan/lit_tests/TestCases/strdup_oob_test.cc
deleted file mode 100644
index e92afd3caaf9..000000000000
--- a/lib/asan/lit_tests/TestCases/strdup_oob_test.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
-
-#include <string.h>
-
-char kString[] = "foo";
-
-int main(int argc, char **argv) {
- char *copy = strdup(kString);
- int x = copy[4 + argc]; // BOOM
- // CHECK: AddressSanitizer: heap-buffer-overflow
- // CHECK: #0 {{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-2]]
- // CHECK: allocated by thread T{{.*}} here:
- // CHECK: #0 {{.*}}strdup
- // CHECK: strdup_oob_test.cc:[[@LINE-6]]
- return x;
-}