Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / describe_address.cpp
blob296d3fdfb26a8e2f812cbba089e138ea012cfae6
1 // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <sanitizer/asan_interface.h>
5 int global;
7 int main(int argc, char *argv[]) {
8 int stack;
9 int *heap = new int[100];
10 __asan_describe_address(heap);
11 // CHECK: {{.*}} is located 0 bytes inside of 400-byte region
12 // CHECK: allocated by thread T{{.*}} here
13 __asan_describe_address(&stack);
14 // CHECK: Address {{.*}} is located in stack of thread T{{.*}} at offset {{.*}}
15 __asan_describe_address(&global);
16 // CHECK: {{.*}} is located 0 bytes inside of global variable '{{.*}}global{{.*}}'
17 delete[] heap;
18 return 0;