diff --git a/lldb/test/API/lang/swift/async/stepping/step-in/task-switch/TestSwiftTaskSwitch.py b/lldb/test/API/lang/swift/async/stepping/step-in/task-switch/TestSwiftTaskSwitch.py index abf418085013f..621edc2e52004 100644 --- a/lldb/test/API/lang/swift/async/stepping/step-in/task-switch/TestSwiftTaskSwitch.py +++ b/lldb/test/API/lang/swift/async/stepping/step-in/task-switch/TestSwiftTaskSwitch.py @@ -15,7 +15,10 @@ def test(self): target, _, thread, _ = lldbutil.run_to_source_breakpoint(self, "await f()", src) self.assertEqual(thread.frame[0].function.mangled, "$s1a5entryO4mainyyYaFZ") - function = target.FindFunctions("$s1a5entryO4mainyyYaFZTQ0_")[0].function + sym_ctx_list = target.FindFunctions("$s1a5entryO4mainyyYaFZTQ0_") + self.assertEqual(sym_ctx_list.GetSize(), 1) + function = sym_ctx_list[0].function + self.assertIsNotNone(function) instructions = list(function.GetInstructions(target)) # Expected to be a trampoline that tail calls `swift_task_switch`.