Skip to content

Commit 1484f1c

Browse files
authored
Merge pull request #82122 from compnerd/versioning
tests: add a new test for the ClangImporter
2 parents 72da5a7 + e4a6190 commit 1484f1c

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,7 @@ module "Weird C Module" {
279279
module Aliases {
280280
header "Aliases.h"
281281
}
282+
283+
module RetroactiveVersioning {
284+
header "versioning.h"
285+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
extern const int kVersion;
3+
extern const int kVersion1;
4+
extern const int kVersion2;
5+
#if OLD_DEPLOYMENT_TARGET
6+
#define kVersion kVersion1
7+
#else
8+
#define kVersion kVersion2
9+
#endif

test/ClangImporter/versioning.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-typecheck-verify-swift %s -I %S/Inputs/custom-modules
2+
// XFAIL: *
3+
4+
// expected-no-diagnostics
5+
6+
import RetroactiveVersioning
7+
let _ = kVersion

0 commit comments

Comments
 (0)