[asan/win] Fix wrong TerminateProcess exit code

Add a test for it.

llvm-svn: 286608
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
index 3aff923..62eac75 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
@@ -659,7 +659,7 @@
   // so add our own breakpoint here.
   if (::IsDebuggerPresent())
     __debugbreak();
-  TerminateProcess(GetCurrentProcess(), 3);
+  TerminateProcess(GetCurrentProcess(), exitcode);
 }
 
 uptr internal_ftruncate(fd_t fd, uptr size) {