Skip to content

[lldb] Re-enable swift step-in test #10006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class TestCase(lldbtest.TestBase):

@swiftTest
@skipIf(oslist=['windows', 'linux'])
@skipIf(bugnumber="rdar://116529018")
def test(self):
"""Test step-in to async functions"""
self.build()
Expand All @@ -34,31 +33,9 @@ def test(self):
process.Continue()
elif stop_reason == lldb.eStopReasonBreakpoint:
caller_before = thread().frames[0].function.GetDisplayName()
line_before = thread().frames[0].line_entry.line
thread().StepInto()
caller_after = thread().frames[1].function.GetDisplayName()
line_after = thread().frames[0].line_entry.line

# Breakpoints on lines with an `await` may result in more than
# one breakpoint location. Specifically a location before an
# async function is called, and then a location on the resume
# function. In this case, running `step` on these lines will
# move execution forward within the same function, _not_ step
# into a new function.
#
# As this test is for stepping into async functions, when the
# step-in keeps execution on the same or next line -- not a
# different function, then it can be ignored. rdar://76116620
if line_after in (line_before, line_before + 1):
# When stepping stops at breakpoint, don't continue.
if thread().stop_reason != lldb.eStopReasonBreakpoint:
process.Continue()
continue

# The entry function is missing this prefix dedicating resume functions.
prefix = re.compile(r'^\([0-9]+\) await resume partial function for ')
self.assertEqual(prefix.sub('', caller_after),
prefix.sub('', caller_before))
self.assertEqual(caller_after, caller_before)
num_async_steps += 1

self.assertGreater(num_async_steps, 0)