Move MSan lit-tests under test/msan
[blocksruntime.git] / lib / asan / lit_tests / TestCases / SharedLibs / dlclose-test-so.cc
blob73e00507358a07e3c0cc8bfcd22be0f7ffb3a69b
1 //===----------- dlclose-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.
12 // Regression test for
13 // http://code.google.com/p/address-sanitizer/issues/detail?id=19
14 //===----------------------------------------------------------------------===//
15 #include <stdio.h>
17 static int pad1;
18 static int static_var;
19 static int pad2;
21 extern "C"
22 int *get_address_of_static_var() {
23 return &static_var;
26 __attribute__((constructor))
27 void at_dlopen() {
28 printf("%s: I am being dlopened\n", __FILE__);
30 __attribute__((destructor))
31 void at_dlclose() {
32 printf("%s: I am being dlclosed\n", __FILE__);