Author: David Spickett
Date: 2025-07-03T09:42:35Z
New Revision: 563bea91222f534d90c2baa645a5e2bc4132e9a8

URL: 
https://github.com/llvm/llvm-project/commit/563bea91222f534d90c2baa645a5e2bc4132e9a8
DIFF: 
https://github.com/llvm/llvm-project/commit/563bea91222f534d90c2baa645a5e2bc4132e9a8.diff

LOG: [lldb][test] Enable TestIRInterpreter on Windows

Relates to https://github.com/llvm/llvm-project/issues/22139

This used to be broken because the expressions didn't work,
but the test also used getpid which isn't avaialable on Windows.

So when the expressions started working, evaluation still failed
due to getpid.

I made it call GetCurrentProcessId and it worked.

Added: 
    

Modified: 
    lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py 
b/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py
index 0515876734ca4..5b8777c7089c2 100644
--- a/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py
+++ b/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py
@@ -105,8 +105,6 @@ def build_and_run(self):
         self.runCmd("run", RUN_SUCCEEDED)
 
     @add_test_categories(["pyapi"])
-    # getpid() is POSIX, among other problems, see bug
-    @expectedFailureAll(oslist=["windows"], 
bugnumber="http://llvm.org/pr21765";)
     def test_ir_interpreter(self):
         self.build_and_run()
 
@@ -137,6 +135,14 @@ def test_ir_interpreter(self):
         for expression in set_up_expressions:
             self.frame().EvaluateExpression(expression, options)
 
+        func_call = "(int)getpid"
+        if lldbplatformutil.getPlatform() == "windows":
+            func_call = "(int)GetCurrentProcessId()"
+
+        for expression in expressions:
+            interp_expression = expression
+            jit_expression = func_call + "; " + expression
+
         for expression in expressions:
             interp_expression = expression
             jit_expression = "(int)getpid(); " + expression


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to