summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/asan/TestCases/SharedLibs/shared-lib-test-so.cc
blob: 6aedc93be3493f2e334e8e8e6eb6b9a1f82970be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//===----------- shared-lib-test-so.cc --------------------------*- C++ -*-===//
//
//                     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.
//
//===----------------------------------------------------------------------===//
#include <stdio.h>
#include <string.h>

int pad[10];
int GLOB[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

extern "C"
void inc(int index) {
  GLOB[index]++;
}

extern "C"
void inc2(int *a, int index) {
  a[index]++;
}

extern "C"
void my_memset(void *p, size_t sz) {
  memset(p, 0, sz);
}
OpenPOWER on IntegriCloud