-
Notifications
You must be signed in to change notification settings - Fork 343
Return a SwiftArrayEmptyBufferHandler if loc points to an EmptyArray Symbol. #10920
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
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SWIFT_SOURCES := main.swift | ||
|
||
include Makefile.rules |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||
import lldb | ||||||
from lldbsuite.test.decorators import * | ||||||
import lldbsuite.test.lldbtest as lldbtest | ||||||
import lldbsuite.test.lldbutil as lldbutil | ||||||
|
||||||
|
||||||
class TestSwiftGlobalEmptyArray(lldbtest.TestBase): | ||||||
@swiftTest | ||||||
def test(self): | ||||||
"""Test that printing a global swift array of type SwiftEmptyArrayStorage uses the correct data formatter""" | ||||||
|
||||||
self.build() | ||||||
filespec = lldb.SBFileSpec("main.swift") | ||||||
target, process, thread, breakpoint1 = lldbutil.run_to_source_breakpoint( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
self, "break here", filespec | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
) | ||||||
self.expect("p x", substrs=["([a.P]) 0 values {}"]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for tests we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even better would be
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
protocol P {} | ||
|
||
func go() { | ||
let x: [any P] = [] | ||
print("break here") | ||
} | ||
|
||
go() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be
_swiftEmptyArrayStorage
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am checking the mangled name:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I inspect an empty array, I see:
I don't see where
$ss19__EmptyArrayStorageCN
comes into play. Also the PR description mentions_swiftEmptyArrayStorage
but the changed code does not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mangled name is for the type metadata for
Swift.__EmptyArrayStorage
.Swift.__EmptyArrayStorage
itself.