mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 02:26:27 +08:00
[asan] Fix mmap_limit_mb test to not use C++11.
llvm-svn: 206182
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Test the mmap_limit_mb flag.
|
||||
//
|
||||
// RUN: %clangxx_asan -std=c++11 -O2 %s -o %t
|
||||
// RUN: %clangxx_asan -O2 %s -o %t
|
||||
// RUN: %t 100 16
|
||||
// RUN: %t 100 1000000
|
||||
// RUN: ASAN_OPTIONS=mmap_limit_mb=500 %t 100 16
|
||||
@@ -22,7 +22,8 @@ int main(int argc, char **argv) {
|
||||
std::vector<char *> v;
|
||||
for (long total = total_mb << 20; total > 0; total -= allocation_size)
|
||||
v.push_back(new char[allocation_size]);
|
||||
for (auto p : v) delete[] p;
|
||||
for (std::vector<char *>::const_iterator it = v.begin(); it != v.end(); ++it)
|
||||
delete[](*it);
|
||||
printf("PASS\n");
|
||||
// CHECK: AddressSanitizer CHECK failed{{.*}}total_mmaped{{.*}}mmap_limit_mb
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user