Skip to content

Commit 859ef7b

Browse files
committed
Add test that we still import Clang decls with rejected SwiftName API notes.
Most cases fall out from swift_name validation on the Clang side dropping invalid API notes, though the validation on the Clang side is conservative and misses some cases. We still have Swift-side work to fall back to the original name here.
1 parent 2fa3da4 commit 859ef7b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/APINotes/broken-swift-name.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ func testBrokenSwiftName(x: inout ZXSpectrum) {
1313

1414
_ = x.misnamedRegister // expected-error{{has no member}}
1515
x.misnamedRegister = 0 // expected-error{{has no member}}
16+
17+
// Ensure that definitions with invalid API notes are still available
18+
// under their original names.
19+
ZXSpectrumGetRegister(&x, 0)
20+
ZXSpectrumSetRegister(&x, 0, 1)
21+
ZXSpectrumGetMisnamedRegister(&x, 0)
22+
// TODO: Conservative validation in Clang doesn't reject the API name here
23+
// ZXSpectrumSetMisnamedRegister(&x, 0, 1)
1624
}

0 commit comments

Comments
 (0)