[asan] add a (disabled) stress test for __asan_get_ownership

llvm-svn: 152362
This commit is contained in:
Kostya Serebryany 2012-03-09 01:48:18 +00:00
parent 1e809b4c4c
commit 8aff411add
1 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,8 @@
#include <stdio.h>
#include <string.h>
#include <vector>
#include "asan_test_config.h"
#include "asan_test_utils.h"
#include "asan_interface.h"
@ -360,3 +362,13 @@ TEST(AddressSanitizerInterface, SetErrorReportCallbackTest) {
EXPECT_DEATH(ACCESS(array, 120), "size Z");
__asan_set_error_report_callback(NULL);
}
TEST(AddressSanitizerInterface, DISABLED_GetOwnershipStressTest) {
std::vector<void *> v;
for (size_t i = 0; i < 3000; i++)
v.push_back(malloc(i * 1000));
for (size_t i = 0; i < 1000000; i++)
__asan_get_ownership(&v);
for (size_t i = 0, n = v.size(); i < n; i++)
free(v[i]);
}