[lldb] check for interop type aliases in tests#13086
Open
hnrklssn wants to merge 2 commits into
Open
Conversation
This updates two tests to align with the new behavior in swiftlang/swift#89531
Now that the Swift compiler no longer strips typedefs from the AST of nodes imported from clang, we need to do this in LLDB instead. Fixes assertion in lang/swift/dwarfimporter/Objective-C/TestSwiftDWARFImporterObjC.py: ``` [2026-06-03T13:19:10.059Z] TypeSystemSwiftTypeRef diverges from SwiftASTContext: $ss4CIntaD != $ss5Int32VD [2026-06-03T13:19:10.059Z] failing type was $ss4CIntaD [2026-06-03T13:19:10.059Z] Assertion failed: (equivalent && "TypeSystemSwiftTypeRef diverges from SwiftASTContext"), function GetCanonicalType, file TypeSystemSwiftTypeRef.cpp, line 3950. ``` Assisted-by: Claude Opus 4.7
hnrklssn
commented
Jun 4, 2026
| // without consulting DWARF or the runtime: these aliases come from the | ||
| // Swift stdlib and have stable per-target underlying types, so keying | ||
| // them off the triple is sufficient. | ||
| if (NodePointer resolved = ResolveStdlibCInteropAlias(dem, node, GetTriple())) |
Member
Author
There was a problem hiding this comment.
This is my attempt to resolve this assertion failure in lang/swift/dwarfimporter/Objective-C/TestSwiftDWARFImporterObjC.py:
[2026-06-03T03:30:15.212Z] TypeSystemSwiftTypeRef diverges from SwiftASTContext: $ss4CIntaD != $ss5Int32VD
[2026-06-03T03:30:15.212Z] failing type was $ss4CIntaD
[2026-06-03T03:30:15.212Z] Assertion failed: (equivalent && "TypeSystemSwiftTypeRef diverges from SwiftASTContext"), function GetCanonicalType, file TypeSystemSwiftTypeRef.cpp, line 3949.
adrian-prantl
left a comment
There was a problem hiding this comment.
It is not great to hardcode these aliases in LLDB, but I also don't see a good way of making them available reliably in -gast-types. TypeSystemSwiftTypeRef doesn't have access to the Swift swiftmodule and we don't generate DWARF for fields outside of embedded Swift. So I'm afraid this is the way to go.
Can you ask Claude to add an LLDB API test that exercises the complete list of types you add here?
I.e.: main.swift
func f() {
let char : CChar = 1
...
and in the test you do lldbutil.check_variable() and verify we get the typename correct?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates two tests to align with the new behavior in swiftlang/swift#89531