[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / compiler-rt / test / asan / TestCases / Windows / sanitizer_purge.cpp
blob9097756449c47aa142632140610ce089f178d3db
1 #include <Windows.h>
2 #include <stdio.h>
3 #include <sanitizer/allocator_interface.h>
4 #include <psapi.h>
6 // RUN: %clang_cl_asan %Od %s %Fe%t
7 // RUN: %t
8 // REQUIRES: asan-64-bits
10 size_t GetRSS() {
11 PROCESS_MEMORY_COUNTERS counters;
12 if (!GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters)))
13 return 0;
14 return counters.WorkingSetSize;
17 int main(){
18 for (int i = 0; i < 1000; i++) {
19 void* a = malloc(1000);
20 free(a);
22 size_t rss_pre = GetRSS();
23 __sanitizer_purge_allocator();
24 size_t rss_post = GetRSS();
26 if (rss_pre <= rss_post){
27 return -1;
30 return 0;