Summary: The lit internal shell is used by default on Windows, and it does not support bash variable expansion. Because bash variable expansion interacts with tokenization, it is prohibitively difficult to make the existing lit shell do general shell variable expansion. The most common use of shell variables in the asan tests is to add options to the default set of options set by lit.cfg. We can avoid the need for variable expansion with a substitution that expands to 'env ASAN_OPTIONS=<defaults:>'. This has the side benefit of shortening the RUN lines, so it seemed better than implementing limited variable expansion in lit. Reviewers: samsonov, filcab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11982 llvm-svn: 244839
37 lines
1010 B
C++
37 lines
1010 B
C++
// Check that we can store lots of stack frames if asked to.
|
|
|
|
// RUN: %clangxx_asan -O0 %s -o %t 2>&1
|
|
// RUN: %env_asan_opts=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s
|
|
// XFAIL: arm-linux-gnueabi
|
|
// XFAIL: armv7l-unknown-linux-gnueabihf
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
template <int depth>
|
|
struct DeepFree {
|
|
static void free(char *x) {
|
|
DeepFree<depth - 1>::free(x);
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct DeepFree<0> {
|
|
static void free(char *x) {
|
|
::free(x);
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
char *x = (char*)malloc(10);
|
|
// deep_free(x);
|
|
DeepFree<200>::free(x);
|
|
return x[5];
|
|
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
|
|
// The libcxxrt demangling procedure on FreeBSD 9.2 incorrectly appends
|
|
// extra 'E' characters to the end of template arguments; see:
|
|
// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192115
|
|
// CHECK: {{DeepFree<36>|DeepFree<36E>}}
|
|
// CHECK: {{DeepFree<98>|DeepFree<98E>}}
|
|
// CHECK: {{DeepFree<115>|DeepFree<115E>}}
|
|
}
|