aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/tests/asan_globals_test.cc
blob: 6467524ca32c2bd485d970cc2213280f4c346377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//===-- asan_globals_test.cc ----------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Some globals in a separate file.
//===----------------------------------------------------------------------===//

extern char glob5[5];
static char static10[10];

int GlobalsTest(int zero) {
  static char func_static15[15];
  glob5[zero] = 0;
  static10[zero] = 0;
  func_static15[zero] = 0;
  return glob5[1] + func_static15[2];
}