[Lldb-commits] [lldb] [lldb][test] Disable MD5 test for old versions of Visual Studio (PR #94325)

Vassil Vassilev via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 4 06:55:34 PDT 2024


https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/94325

>From 125112e5864affd45a016a0870a40d2b4f516732 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 4 Jun 2024 09:32:22 +0000
Subject: [PATCH 1/2] [lldb][test] Disable MD5 test for old versions of Visual
 Studio

In older versions there is this problem:
https://developercommunity.visualstudio.com/t/c-shared-state-futuresstate-default-constructs-the/60897

Which prevents us making a future out of a result type. There's
no good workaround so just don't compile this for older versions.
---
 .../Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 24111396b0ac6..7e95b16308321 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -593,6 +593,10 @@ TEST_F(GDBRemoteCommunicationClientTest, WriteMemoryTags) {
                  "E03", false);
 }
 
+// Prior to this verison, constructing a std::future for a type without a
+// default constructor is not possible.
+// https://developercommunity.visualstudio.com/t/c-shared-state-futuresstate-default-constructs-the/60897
+#if _MSC_VER >= 1932
 TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
   FileSpec file_spec("/foo/bar", FileSpec::Style::posix);
   std::future<ErrorOr<MD5::MD5Result>> async_result = std::async(
@@ -614,3 +618,4 @@ TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
   EXPECT_EQ(expected_low, result->low());
   EXPECT_EQ(expected_high, result->high());
 }
+#endif

>From c790d42ea4fdf6c75cef04504c4366dc9572743b Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 4 Jun 2024 13:55:00 +0000
Subject: [PATCH 2/2] Check for non-msvc compilers

---
 .../Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 7e95b16308321..11e14f9472164 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -596,7 +596,7 @@ TEST_F(GDBRemoteCommunicationClientTest, WriteMemoryTags) {
 // Prior to this verison, constructing a std::future for a type without a
 // default constructor is not possible.
 // https://developercommunity.visualstudio.com/t/c-shared-state-futuresstate-default-constructs-the/60897
-#if _MSC_VER >= 1932
+#if !defined(_MSC_VER) || _MSC_VER >= 1932
 TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
   FileSpec file_spec("/foo/bar", FileSpec::Style::posix);
   std::future<ErrorOr<MD5::MD5Result>> async_result = std::async(



More information about the lldb-commits mailing list