[ASan] move declaration of __asan_default_options to interface header

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161932 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_flags.h b/lib/asan/asan_flags.h
index 3e37550..e259f11 100644
--- a/lib/asan/asan_flags.h
+++ b/lib/asan/asan_flags.h
@@ -23,12 +23,6 @@
 //    __asan_default_options().
 // 3) overriden from env variable ASAN_OPTIONS.
 
-extern "C" {
-// Can be overriden by user.
-const char *__asan_default_options()
-    SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
-}  // extern "C"
-
 namespace __asan {
 
 struct Flags {
diff --git a/lib/asan/asan_interface.h b/lib/asan/asan_interface.h
index c1390ce..8195c47 100644
--- a/lib/asan/asan_interface.h
+++ b/lib/asan/asan_interface.h
@@ -161,6 +161,11 @@
   // Prints accumulated stats to stderr. Used for debugging.
   void __asan_print_accumulated_stats()
       SANITIZER_INTERFACE_ATTRIBUTE;
-}  // namespace
+
+  // This function may be overriden by user to provide a string containing
+  // ASan runtime options. See asan_flags.h for details.
+  const char* __asan_default_options()
+      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+}  // extern "C"
 
 #endif  // ASAN_INTERFACE_H
diff --git a/lib/asan/output_tests/test_output.sh b/lib/asan/output_tests/test_output.sh
index fccdb0d..5dd4e9b 100755
--- a/lib/asan/output_tests/test_output.sh
+++ b/lib/asan/output_tests/test_output.sh
@@ -49,7 +49,7 @@
 
 echo "Checking the presense of interface symbols in compiled file"
 $CC -g -faddress-sanitizer -dead_strip -O2 $C_TEST.c
-nm ./a.out | grep " T " | sed "s/.* T //" | grep "__asan_" | sed "s/___asan_/__asan_/" > symbols.txt
+nm ./a.out | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" | grep "__asan_" | sed "s/___asan_/__asan_/" > symbols.txt
 cat $ASAN_INTERFACE_H | sed "s/\/\/.*//" | grep "__asan_.*("  | sed "s/.* __asan_/__asan_/;s/(.*//" > interface.txt
 for i in __asan_report_{load,store}{1,2,4,8,16}
 do