asan_globals_test.cc revision b0ddf227b25388ad836e560c00f0aec84026b0e5
1//===-- asan_globals_test.cc ----------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of AddressSanitizer, an address sanity checker.
11//
12// Some globals in a separate file.
13//===----------------------------------------------------------------------===//
14
15extern char glob5[5];
16static char static10[10];
17
18int GlobalsTest(int zero) {
19  static char func_static15[15];
20  glob5[zero] = 0;
21  static10[zero] = 0;
22  func_static15[zero] = 0;
23  return glob5[1] + func_static15[2];
24}
25