diff --git a/lldb/test/API/lang/cpp/static_members/TestCPPStaticMembers.py b/lldb/test/API/lang/cpp/static_members/TestCPPStaticMembers.py --- a/lldb/test/API/lang/cpp/static_members/TestCPPStaticMembers.py +++ b/lldb/test/API/lang/cpp/static_members/TestCPPStaticMembers.py @@ -71,3 +71,20 @@ # Evaluating the expression via JIT should work fine. value = self.target().EvaluateExpression(expr) self.assertSuccess(value.GetError()) + + # We fail to lookup static members on Windows. + @expectedFailureAll(oslist=["windows"]) + def test_IR_interpreter_can_handle_getelementptr_constants_args(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "// stop in main", lldb.SBFileSpec("main.cpp")) + + # This expression contains the following IR code: + # ... getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0 + expr = "arr[0]" + + # The IR interpreter supports const operands to the `GetElementPtr` IR + # instruction, so it should be able to evaluate expression without JIT. + opts = lldb.SBExpressionOptions() + opts.SetAllowJIT(False) + value = self.target().EvaluateExpression(expr, opts) + self.assertSuccess(value.GetError()) diff --git a/lldb/test/API/lang/cpp/static_members/main.cpp b/lldb/test/API/lang/cpp/static_members/main.cpp --- a/lldb/test/API/lang/cpp/static_members/main.cpp +++ b/lldb/test/API/lang/cpp/static_members/main.cpp @@ -15,6 +15,8 @@ A my_a; my_a.m_a = 1; + int arr[2]{0}; + my_a.access(); // stop in main return 0; }