<div dir="ltr">Would this fix <a href="https://bugs.llvm.org/show_bug.cgi?id=51446">https://bugs.llvm.org/show_bug.cgi?id=51446</a> by any chance? Should I give it a spin on the release branch?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 29 Sept 2021 at 17:04, Raphael Isemann via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Raphael Isemann<br>
Date: 2021-09-29T17:03:37+02:00<br>
New Revision: f939a32e5c483686af16561211d77c06a5579011<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/f939a32e5c483686af16561211d77c06a5579011" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f939a32e5c483686af16561211d77c06a5579011</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/f939a32e5c483686af16561211d77c06a5579011.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f939a32e5c483686af16561211d77c06a5579011.diff</a><br>
<br>
LOG: [lldb] Fix TestImportStdModule on some setups by testing minmax instead of abs<br>
<br>
Some downstream forks of LLDB change parts of the test setup in a way that<br>
causes lldb to somehow resolve `std::abs` (probably to `::abs`). This patch<br>
changes the tested function here to be `std::minmax` which (hopefully) doesn't<br>
have any identically named functions that LLDB could find and call. Just to be<br>
extra safe this also explicitly specified the template arguments so that in<br>
case there is a `minmax` non-template function we still don't end up calling it<br>
from this test.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py b/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py<br>
index c60e280dd65d6..695d00b08a0f5 100644<br>
--- a/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py<br>
+++ b/lldb/test/API/commands/expression/import-std-module/basic/TestImportStdModule.py<br>
@@ -24,6 +24,8 @@ def test(self):<br>
         self.runCmd("settings set target.import-std-module true")<br>
         # Calling some normal std functions that return non-template types.<br>
         self.expect_expr("std::abs(-42)", result_type="int", result_value="42")<br>
+        self.expect_expr("std::minmax<int>(1, 2).first", result_type="const int",<br>
+            result_value="1")<br>
         self.expect_expr("std::div(2, 1).quot",<br>
                          result_type="int",<br>
                          result_value="2")<br>
@@ -50,7 +52,7 @@ def test_non_cpp_language(self):<br>
         self.runCmd("settings set target.import-std-module true")<br>
         # These languages don't support C++ modules, so they shouldn't<br>
         # be able to evaluate the expression.<br>
-        self.expect("expr -l C -- std::abs(-42)", error=True)<br>
-        self.expect("expr -l C99 -- std::abs(-42)", error=True)<br>
-        self.expect("expr -l C11 -- std::abs(-42)", error=True)<br>
-        self.expect("expr -l ObjC -- std::abs(-42)", error=True)<br>
+        self.expect("expr -l C -- std::minmax<int>(1, 2).first", error=True)<br>
+        self.expect("expr -l C99 -- std::minmax<int>(1, 2).first", error=True)<br>
+        self.expect("expr -l C11 -- std::minmax<int>(1, 2).first", error=True)<br>
+        self.expect("expr -l ObjC -- std::minmax<int>(1, 2).first", error=True)<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>