1 //===----------- dlclose-test-so.cc -----------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of AddressSanitizer, an address sanity checker.
10 // Regression test for
11 // http://code.google.com/p/address-sanitizer/issues/detail?id=19
12 //===----------------------------------------------------------------------===//
17 static int static_var
;
21 int *get_address_of_static_var() {
25 __attribute__((constructor
))
27 printf("%s: I am being dlopened\n", __FILE__
);
29 __attribute__((destructor
))
31 printf("%s: I am being dlclosed\n", __FILE__
);