Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / pr52382.c
blob6150c936f6bbd3fdca0ea11e43a2380427b827d9
1 // RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -o - -fsanitize=address %s | FileCheck %s
3 // Ensure that ASan properly instruments a load into a global where the index
4 // happens to be within the padding after the global which is used for the
5 // redzone.
7 // This global is 400 bytes long, but gets padded with 112 bytes for redzones,
8 // rounding the total size after instrumentation to 512.
9 int global_array[100] = {-1};
11 // This access is 412 bytes after the start of the global: past the end of the
12 // uninstrumented array, but within the bounds of the extended instrumented
13 // array. We should ensure this is still instrumented.
14 int main(void) { return global_array[103]; }
16 // CHECK: @main
17 // CHECK-NEXT: entry:
18 // CHECK: call void @__asan_report_load4
19 // CHECK: }