1//===----------- dlclose-test-so.cc -----------------------------*- C++ -*-===// 2// 3// This file is distributed under the University of Illinois Open Source 4// License. See LICENSE.TXT for details. 5// 6//===----------------------------------------------------------------------===// 7// 8// This file is a part of AddressSanitizer, an address sanity checker. 9// 10// Regression test for 11// http://code.google.com/p/address-sanitizer/issues/detail?id=19 12//===----------------------------------------------------------------------===// 13 14#include <stdio.h> 15 16static int pad1; 17static int static_var; 18static int pad2; 19 20extern "C" 21int *get_address_of_static_var() { 22 return &static_var; 23} 24 25__attribute__((constructor)) 26void at_dlopen() { 27 printf("%s: I am being dlopened\n", __FILE__); 28} 29__attribute__((destructor)) 30void at_dlclose() { 31 printf("%s: I am being dlclosed\n", __FILE__); 32} 33