summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-04-05 15:13:23 +0000
committerKostya Serebryany <kcc@google.com>2013-04-05 15:13:23 +0000
commitf5407e8d8f9c7472ebcf158b64e149099cba284a (patch)
tree52c6f3a4542af0ea07844c99c2010b71668f5898
parent1b818299797319147323b1b34e1b014da4f37d59 (diff)
downloadbcm5719-llvm-f5407e8d8f9c7472ebcf158b64e149099cba284a.tar.gz
bcm5719-llvm-f5407e8d8f9c7472ebcf158b64e149099cba284a.zip
[asan] add a test for huge left oob
llvm-svn: 178874
-rw-r--r--compiler-rt/lib/asan/lit_tests/huge_negative_hea_oob.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/huge_negative_hea_oob.cc b/compiler-rt/lib/asan/lit_tests/huge_negative_hea_oob.cc
new file mode 100644
index 00000000000..bc71b644f02
--- /dev/null
+++ b/compiler-rt/lib/asan/lit_tests/huge_negative_hea_oob.cc
@@ -0,0 +1,10 @@
+// RUN: %clangxx_asan -m64 %s -o %t && %t 2>&1 | %symbolize > %t.out
+// Check that we can find huge buffer overflows to the left.
+#include <stdlib.h>
+#include <string.h>
+int main(int argc, char **argv) {
+ char *x = (char*)malloc(1 << 20);
+ memset(x, 0, 10);
+ int res = x[-argc * 4000]; // BOOOM
+ // CHECK: is located 4000 bytes to the left of
+}
OpenPOWER on IntegriCloud