[compiler-rt] Changes to support running tests for Windows arm64 asan (PR #66973)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 22:26:59 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 9abf3df111793831dd2fb6dce4cf34c84a5277dc 141c9aa7f9b1a6f7b4f877a82c4ccf92ae2b8287 -- compiler-rt/lib/interception/interception_win.cpp compiler-rt/lib/interception/tests/interception_win_test.cpp compiler-rt/lib/sanitizer_common/sanitizer_platform.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index 4c1c4ca098ee..3b982a9f53ee 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -462,7 +462,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
   return 4;
 #endif
 
-#if SANITIZER_WINDOWSx64
+#  if SANITIZER_WINDOWSx64
   if (memcmp((u8*)address, kPrologueWithShortJump1,
              sizeof(kPrologueWithShortJump1)) == 0 ||
       memcmp((u8*)address, kPrologueWithShortJump2,
@@ -544,7 +544,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
       return 7;
   }
 
-#if SANITIZER_WINDOWSx64
+#  if SANITIZER_WINDOWSx64
   switch (*(u8*)address) {
     case 0xA1:  // A1 XX XX XX XX XX XX XX XX :
                 //   movabs eax, dword ptr ds:[XXXXXXXX]
diff --git a/compiler-rt/lib/interception/tests/interception_win_test.cpp b/compiler-rt/lib/interception/tests/interception_win_test.cpp
index 629cdf437f34..03202d23e5bb 100644
--- a/compiler-rt/lib/interception/tests/interception_win_test.cpp
+++ b/compiler-rt/lib/interception/tests/interception_win_test.cpp
@@ -17,12 +17,12 @@
 // Too slow for debug build
 #if !SANITIZER_DEBUG
 #if SANITIZER_WINDOWS
-#if !SANITIZER_WINDOWSARM64
+#    if !SANITIZER_WINDOWSARM64
 
-#include <stdarg.h>
+#      include <stdarg.h>
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#      define WIN32_LEAN_AND_MEAN
+#      include <windows.h>
 
 namespace __interception {
 namespace {
@@ -794,6 +794,6 @@ TEST(Interception, EmptyExportTable) {
 
 }  // namespace __interception
 
-#endif   // !SANITIZER_WINDOWSARM64
+#    endif  // !SANITIZER_WINDOWSARM64
 #endif  // SANITIZER_WINDOWS
 #endif  // #if !SANITIZER_DEBUG

``````````

</details>


https://github.com/llvm/llvm-project/pull/66973


More information about the llvm-commits mailing list