Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / debug_mapping.cpp
blob40083f02853fcd00b96686428cec13b3a2311d4e
1 // Checks that the debugging API returns correct shadow scale and offset.
2 // RUN: %clangxx_asan -O %s -o %t
3 // RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s
5 #include <sanitizer/asan_interface.h>
6 #include <stdio.h>
7 #include <stdlib.h>
9 #if _WIN64
10 #define PTR "%llx"
11 #else
12 #define PTR "%lx"
13 #endif
15 // printed because of verbosity=1
16 // CHECK: SHADOW_SCALE: [[SCALE:[0-9]+]]
17 // CHECK: SHADOW_OFFSET: [[OFFSET:0x[0-9a-f]+]]
19 int main() {
20 size_t scale, offset;
21 __asan_get_shadow_mapping(&scale, &offset);
23 fprintf(stderr, "scale: %d\n", (int)scale);
24 fprintf(stderr, "offset: 0x" PTR "\n", (void*)offset);
26 // CHECK: scale: [[SCALE]]
27 // CHECK: offset: [[OFFSET]]
29 return 0;