[PATCH] D22484: [compiler-rt] Fix Asan imports/exports unittest
Etienne Bergeron via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 07:48:20 PDT 2016
etienneb updated this revision to Diff 64500.
etienneb added a comment.
better solution
https://reviews.llvm.org/D22484
Files:
test/asan/TestCases/Windows/dll_host.cc
Index: test/asan/TestCases/Windows/dll_host.cc
===================================================================
--- test/asan/TestCases/Windows/dll_host.cc
+++ test/asan/TestCases/Windows/dll_host.cc
@@ -5,20 +5,35 @@
// RUN: %clang_cl_asan -O0 %s -Fe%t
//
// Get the list of ASan wrappers exported by the main module RTL:
-// RUN: dumpbin /EXPORTS %t | grep -o "__asan_wrap[^ ]*" | grep -v @ | sort | uniq > %t.exported_wrappers
+// RUN: dumpbin /EXPORTS %t | grep -o "__asan_wrap[^ ]*" | sed -e s/@.*// > %t.exported_wrappers
// FIXME: we should really check the other __asan exports too.
-// RUN: dumpbin /EXPORTS %t | grep -o "__sanitizer_[^ ]*" | grep -v @ | sort | uniq >> %t.exported_wrappers
+// RUN: dumpbin /EXPORTS %t | grep -o "__sanitizer_[^ ]*" | sed -e s/@.*// >> %t.exported_wrappers
//
// Get the list of ASan wrappers imported by the DLL RTL:
// [BEWARE: be really careful with the sed commands, as this test can be run
// from different environemnts with different shells and seds]
-// RUN: grep INTERCEPT_LIBRARY_FUNCTION %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(/__asan_wrap_/ | sed -e s/).*// | sort | uniq > %t.dll_imports
-// RUN: grep "^INTERFACE_FUNCTION.*sanitizer" %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(// | sed -e s/).*// | sort | uniq >> %t.dll_imports
+// RUN: grep INTERCEPT_LIBRARY_FUNCTION %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(/__asan_wrap_/ | sed -e s/).*// > %t.dll_imports
+// RUN: grep "^INTERFACE_FUNCTION.*sanitizer" %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(// | sed -e s/).*// >> %t.dll_imports
+//
+// RUN: echo "__asan_wrap_HeapAlloc" >> %t.dll_imports
+// RUN: echo "__asan_wrap_HeapFree" >> %t.dll_imports
+// RUN: echo "__asan_wrap_HeapReAlloc" >> %t.dll_imports
+// RUN: echo "__asan_wrap_HeapSize" >> %t.dll_imports
+// RUN: echo "__asan_wrap_CreateThread" >> %t.dll_imports
+// RUN: echo "__asan_wrap_NtWaitForWorkViaWorkerFactory" >> %t.dll_imports
+// RUN: echo "__asan_wrap_RaiseException" >> %t.dll_imports
+//
+// RUN: echo "__asan_wrap__except_handler3" >> %t.exported_wrappers
+// RUN: echo "__asan_wrap__except_handler4" >> %t.exported_wrappers
+// RUN: echo "__asan_wrap___C_specific_handler" >> %t.exported_wrappers
+//
+// RUN: sort %t.dll_imports | uniq > %t.dll_imports-sorted
+// RUN: sort %t.exported_wrappers | uniq > %t.exported_wrappers-sorted
//
// Now make sure the DLL thunk imports everything:
// RUN: echo
// RUN: echo "=== NOTE === If you see a mismatch below, please update asan_win_dll_thunk.cc"
-// RUN: diff %t.dll_imports %t.exported_wrappers
+// RUN: diff %t.dll_imports-sorted %t.exported_wrappers-sorted
// REQUIRES: asan-static-runtime
#include <stdio.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22484.64500.patch
Type: text/x-patch
Size: 2808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160719/9ca1e488/attachment.bin>
More information about the llvm-commits
mailing list