1 //===----------- shared-lib-test-so.cc --------------------------*- C++ -*-===// 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 //===----------------------------------------------------------------------===// 13 #include <stdio.h> 14 15 int pad[10]; 16 int GLOB[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 17 18 extern "C" 19 void inc(int index) { 20 GLOB[index]++; 21 } 22 23 extern "C" 24 void inc2(int *a, int index) { 25 a[index]++; 26 } 27