13 lines · c
1// RUN: %clang_asan -O0 %s -o %t -w && not %run %t 2>&1 | FileCheck %s2// RUN: %clang_asan -O2 %s -o %t -w && not %run %t 2>&1 | FileCheck %s3 4int global_array[100] = {-1};5 6// This access is 412 bytes after the start of the global: past the end of the7// uninstrumented array, but within the bounds of the extended instrumented8// array. We should ensure this is still instrumented.9int main(void) { return global_array[103]; }10 11// CHECK: AddressSanitizer: global-buffer-overflow on address12// CHECK: is located 12 bytes after global variable 'global_array'13