Skip to content

Commit 563bea9

Browse files
committed
[lldb][test] Enable TestIRInterpreter on Windows
Relates to #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.
1 parent d56c06e commit 563bea9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ def build_and_run(self):
105105
self.runCmd("run", RUN_SUCCEEDED)
106106

107107
@add_test_categories(["pyapi"])
108-
# getpid() is POSIX, among other problems, see bug
109-
@expectedFailureAll(oslist=["windows"], bugnumber="http://llvm.org/pr21765")
110108
def test_ir_interpreter(self):
111109
self.build_and_run()
112110

@@ -137,6 +135,14 @@ def test_ir_interpreter(self):
137135
for expression in set_up_expressions:
138136
self.frame().EvaluateExpression(expression, options)
139137

138+
func_call = "(int)getpid"
139+
if lldbplatformutil.getPlatform() == "windows":
140+
func_call = "(int)GetCurrentProcessId()"
141+
142+
for expression in expressions:
143+
interp_expression = expression
144+
jit_expression = func_call + "; " + expression
145+
140146
for expression in expressions:
141147
interp_expression = expression
142148
jit_expression = "(int)getpid(); " + expression

0 commit comments

Comments
 (0)