Skip to content

Commit

Permalink
Add test that we still import Clang decls with rejected SwiftName API…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
jckarter committed May 19, 2016
1 parent 2fa3da4 commit 859ef7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/APINotes/broken-swift-name.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ func testBrokenSwiftName(x: inout ZXSpectrum) {

_ = x.misnamedRegister // expected-error{{has no member}}
x.misnamedRegister = 0 // expected-error{{has no member}}

// Ensure that definitions with invalid API notes are still available
// under their original names.
ZXSpectrumGetRegister(&x, 0)
ZXSpectrumSetRegister(&x, 0, 1)
ZXSpectrumGetMisnamedRegister(&x, 0)
// TODO: Conservative validation in Clang doesn't reject the API name here
// ZXSpectrumSetMisnamedRegister(&x, 0, 1)
}

0 comments on commit 859ef7b

Please sign in to comment.