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#include "asan_test_utils.h"
15
16char glob1[1];
17char glob2[2];
18char glob3[3];
19char glob4[4];
20char glob5[5];
21char glob6[6];
22char glob7[7];
23char glob8[8];
24char glob9[9];
25char glob10[10];
26char glob11[11];
27char glob12[12];
28char glob13[13];
29char glob14[14];
30char glob15[15];
31char glob16[16];
32char glob17[17];
33char glob1000[1000];
34char glob10000[10000];
35char glob100000[100000];
36
37static char static10[10];
38
39int GlobalsTest(int zero) {
40  static char func_static15[15];
41  glob5[zero] = 0;
42  static10[zero] = 0;
43  func_static15[zero] = 0;
44  return glob5[1] + func_static15[2];
45}
46