Skip to content

Commit b535a88

Browse files
committed
Add a test importing a Clang module with non-identifier characters.
This requires no additional work beyond just parsing the identifier because Clang module maps already support such names in quotes.
1 parent 51c3d59 commit b535a88

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
typedef struct {
2+
int value;
3+
} S;

test/ClangImporter/Inputs/custom-modules/module.modulemap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,7 @@ module CommonName {
271271
header "CommonName.h"
272272
export *
273273
}
274+
275+
module "^*Weird.C.Module*^" {
276+
header "WeirdCModule.h"
277+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs/custom-modules %s -verify
2+
3+
import `^*Weird.C.Module*^`
4+
5+
_ = S().value
6+
_ = `^*Weird.C.Module*^`.S().value

0 commit comments

Comments
 (0)