summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2017-11-09 19:26:54 +0000
committerTeresa Johnson <tejohnson@google.com>2017-11-09 19:26:54 +0000
commitc483d54d4a6d703121c3054a522f1eeb745287d2 (patch)
treed37b86d51005e2cf34fda6bb4d869faa790d2554 /test
parentc14c76790fe46e1ef96eb53779a5b6ea9a4b7a4a (diff)
Revert new ThinLTO ASAN test until lit support added
This reverts commit r317723 and r317728. Will be re-added when support for LTO/ThinLTO added to test/asan/lit.cfg. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc55
1 files changed, 0 insertions, 55 deletions
diff --git a/test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc b/test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc
deleted file mode 100644
index 5c082edce..000000000
--- a/test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// RUN: %clangxx_asan -flto=thin -O %s -o %t.thinlto
-// RUN: not %run %t.thinlto crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
-// RUN: not %run %t.thinlto bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
-// RUN: not %run %t.thinlto bad-alignment 2>&1 | FileCheck --check-prefix=CHECK-BAD-ALIGNMENT %s
-// RUN: %env_asan_opts=detect_container_overflow=0 %run %t.thinlto crash
-//
-// Test crash due to __sanitizer_annotate_contiguous_container.
-
-// REQUIRES: lto
-
-#include <assert.h>
-#include <string.h>
-
-extern "C" {
-void __sanitizer_annotate_contiguous_container(const void *beg, const void *end,
- const void *old_mid,
- const void *new_mid);
-} // extern "C"
-
-static volatile int one = 1;
-
-int TestCrash() {
- long t[100];
- t[60] = 0;
- __sanitizer_annotate_contiguous_container(&t[0], &t[0] + 100, &t[0] + 100,
- &t[0] + 50);
-// CHECK-CRASH: AddressSanitizer: container-overflow
-// CHECK-CRASH: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0
- return (int)t[60 * one]; // Touches the poisoned memory.
-}
-
-void BadBounds() {
- long t[100];
-// CHECK-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
- __sanitizer_annotate_contiguous_container(&t[0], &t[0] + 100, &t[0] + 101,
- &t[0] + 50);
-}
-
-void BadAlignment() {
- int t[100];
-// CHECK-BAD-ALIGNMENT: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
-// CHECK-BAD-ALIGNMENT: ERROR: beg is not aligned by 8
- __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[1] + 10,
- &t[0] + 50);
-}
-
-int main(int argc, char **argv) {
- assert(argc == 2);
- if (!strcmp(argv[1], "crash"))
- return TestCrash();
- else if (!strcmp(argv[1], "bad-bounds"))
- BadBounds();
- else if (!strcmp(argv[1], "bad-alignment"))
- BadAlignment();
-}