Skip to content

Commit 4b3c51f

Browse files
authored
Merge pull request #65081 from hyp/eng/5.8-frt
[interop] add availability for foreign reference types
2 parents 5fa6d08 + 380f9a7 commit 4b3c51f

26 files changed

+132
-50
lines changed

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ public struct DiagnosticFixIt {
5353
}
5454

5555
public struct DiagnosticEngine {
56-
private let bridged: swift.DiagnosticEngine
56+
private let bridged: BridgedDiagnosticEngine
5757

58-
public init(bridged: swift.DiagnosticEngine) {
58+
public init(bridged: BridgedDiagnosticEngine) {
5959
self.bridged = bridged
6060
}
61+
public init?(bridged: BridgedOptionalDiagnosticEngine) {
62+
guard let object = bridged.object else {
63+
return nil
64+
}
65+
self.bridged = BridgedDiagnosticEngine(object: object)
66+
}
6167

6268
public func diagnose(_ position: SourceLoc?,
6369
_ id: DiagID,

SwiftCompilerSources/Sources/Parse/Regex.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private func _RegexLiteralLexingFn(
4646
_ curPtrPtr: UnsafeMutablePointer<UnsafePointer<CChar>>,
4747
_ bufferEndPtr: UnsafePointer<CChar>,
4848
_ mustBeRegex: CBool,
49-
_ bridgedDiagnosticEngine: swift.DiagnosticEngine?
49+
_ bridgedDiagnosticEngine: BridgedOptionalDiagnosticEngine
5050
) -> /*CompletelyErroneous*/ CBool {
5151
let inputPtr = curPtrPtr.pointee
5252

@@ -62,8 +62,7 @@ private func _RegexLiteralLexingFn(
6262

6363
if let error = error {
6464
// Emit diagnostic if diagnostics are enabled.
65-
if let bridged = bridgedDiagnosticEngine {
66-
let diagEngine = DiagnosticEngine(bridged: bridged)
65+
if let diagEngine = DiagnosticEngine(bridged: bridgedDiagnosticEngine) {
6766
let startLoc = SourceLoc(
6867
locationInFile: error.location.assumingMemoryBound(to: UInt8.self))!
6968
diagEngine.diagnose(startLoc, .foreign_diagnostic, error.message)
@@ -94,7 +93,7 @@ public func _RegexLiteralParsingFn(
9493
_ captureStructureOut: UnsafeMutableRawPointer,
9594
_ captureStructureSize: CUnsignedInt,
9695
_ bridgedDiagnosticBaseLoc: swift.SourceLoc,
97-
_ bridgedDiagnosticEngine: swift.DiagnosticEngine
96+
_ bridgedDiagnosticEngine: BridgedDiagnosticEngine
9897
) -> Bool {
9998
let str = String(cString: inputPtr)
10099
let captureBuffer = UnsafeMutableRawBufferPointer(

include/swift/AST/ASTBridging.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,22 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedDiagID : uint32_t {
3232
#include "swift/AST/DiagnosticsAll.def"
3333
} BridgedDiagID;
3434

35+
typedef struct {
36+
void * _Nonnull object;
37+
} BridgedDiagnosticEngine;
38+
39+
typedef struct {
40+
void *_Nullable object;
41+
} BridgedOptionalDiagnosticEngine;
42+
3543
// FIXME: Can we bridge InFlightDiagnostic?
36-
void DiagnosticEngine_diagnose(swift::DiagnosticEngine &, swift::SourceLoc loc,
44+
void DiagnosticEngine_diagnose(BridgedDiagnosticEngine, swift::SourceLoc loc,
3745
BridgedDiagID diagID, BridgedArrayRef arguments,
3846
swift::CharSourceRange highlight,
3947
BridgedArrayRef fixIts);
4048

49+
bool DiagnosticEngine_hadAnyError(BridgedDiagnosticEngine);
50+
4151
using ArrayRefOfDiagnosticArgument = llvm::ArrayRef<swift::DiagnosticArgument>;
4252

4353
SWIFT_END_NULLABILITY_ANNOTATIONS

include/swift/AST/BridgingUtils.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//===--- BridgingUtils.h - utilities for swift bridging -------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2022 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef SWIFT_AST_BRIDGINGUTILS_H
14+
#define SWIFT_AST_BRIDGINGUTILS_H
15+
16+
#include "swift/AST/ASTBridging.h"
17+
#include "swift/AST/DiagnosticEngine.h"
18+
19+
namespace swift {
20+
21+
inline BridgedDiagnosticEngine getBridgedDiagnosticEngine(DiagnosticEngine *D) {
22+
return {(void *)D};
23+
}
24+
inline BridgedOptionalDiagnosticEngine
25+
getBridgedOptionalDiagnosticEngine(DiagnosticEngine *D) {
26+
return {(void *)D};
27+
}
28+
29+
} // namespace swift
30+
31+
#endif
32+

include/swift/AST/DiagnosticEngine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ namespace swift {
804804

805805
/// Class responsible for formatting diagnostics and presenting them
806806
/// to the user.
807-
class SWIFT_IMPORT_REFERENCE DiagnosticEngine {
807+
class DiagnosticEngine {
808808
public:
809809
/// The source manager used to interpret source locations and
810810
/// display diagnostics.

include/swift/Basic/Compiler.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@
184184
#define SWIFT_VFORMAT(fmt)
185185
#endif
186186

187-
// Tells Swift's ClangImporter to import a C++ type as a foreign reference type.
188-
#if __has_attribute(swift_attr)
189-
#define SWIFT_IMPORT_REFERENCE __attribute__((swift_attr("import_reference"))) \
190-
__attribute__((swift_attr("retain:immortal"))) \
191-
__attribute__((swift_attr("release:immortal")))
192-
#else
193-
#define SWIFT_IMPORT_REFERENCE
194-
#endif
195-
196187
#if __has_attribute(enum_extensibility)
197188
#define ENUM_EXTENSIBILITY_ATTR(arg) __attribute__((enum_extensibility(arg)))
198189
#else

include/swift/Parse/RegexParserBridging.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
/// past.
2828
/// - MustBeRegex: whether an error during lexing should be considered a regex
2929
/// literal, or some thing else.
30-
/// - OptionalDiagnosticEngine: RegexLiteralLexingFn should diagnose the
31-
/// token using this engine.
30+
/// - BridgedOptionalDiagnosticEngine: RegexLiteralLexingFn should diagnose the
31+
/// token using this engine.
3232
///
3333
/// Returns: A bool indicating whether lexing was completely erroneous, and
3434
/// cannot be recovered from, or false if there either was no error,
3535
/// or there was a recoverable error.
3636
typedef bool (*RegexLiteralLexingFn)(
3737
/*CurPtrPtr*/ const char *_Nonnull *_Nonnull,
3838
/*BufferEnd*/ const char *_Nonnull,
39-
/*MustBeRegex*/ bool, swift::DiagnosticEngine *_Nullable);
39+
/*MustBeRegex*/ bool, BridgedOptionalDiagnosticEngine);
4040
void Parser_registerRegexLiteralLexingFn(RegexLiteralLexingFn _Nullable fn);
4141

4242
/// Parse a regex literal string. Takes the following arguments:
@@ -48,16 +48,16 @@ void Parser_registerRegexLiteralLexingFn(RegexLiteralLexingFn _Nullable fn);
4848
/// - CaptureStructureSize: The size of the capture structure buffer. Must be
4949
/// greater than or equal to `strlen(InputPtr) + 3`.
5050
/// - DiagnosticBaseLoc: Start location of the regex literal.
51-
/// - DiagnosticEngine: RegexLiteralParsingFn should diagnose the
52-
/// parsing errors using this engine.
51+
/// - BridgedDiagnosticEngine: RegexLiteralParsingFn should diagnose the
52+
/// parsing errors using this engine.
5353
///
5454
/// Returns: A bool value indicating if there was an error while parsing.
5555
typedef bool (*RegexLiteralParsingFn)(/*InputPtr*/ const char *_Nonnull,
5656
/*VersionOut*/ unsigned *_Nonnull,
5757
/*CaptureStructureOut*/ void *_Nonnull,
5858
/*CaptureStructureSize*/ unsigned,
5959
/*DiagnosticBaseLoc*/ swift::SourceLoc,
60-
swift::DiagnosticEngine &);
60+
BridgedDiagnosticEngine);
6161
void Parser_registerRegexLiteralParsingFn(RegexLiteralParsingFn _Nullable fn);
6262

6363
#endif // REGEX_PARSER_BRIDGING

lib/AST/ASTBridging.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,28 @@
1717

1818
using namespace swift;
1919

20+
namespace {
21+
/// BridgedDiagnosticEngine -> DiagnosticEngine *.
22+
DiagnosticEngine *getDiagnosticEngine(const BridgedDiagnosticEngine &bridged) {
23+
return static_cast<DiagnosticEngine *>(bridged.object);
24+
}
25+
26+
} // namespace
27+
2028
void DiagnosticEngine_diagnose(
21-
DiagnosticEngine &engine, SourceLoc loc, BridgedDiagID bridgedDiagID,
29+
BridgedDiagnosticEngine bridgedEngine, SourceLoc loc,
30+
BridgedDiagID bridgedDiagID,
2231
BridgedArrayRef /*DiagnosticArgument*/ bridgedArguments,
2332
CharSourceRange highlight,
2433
BridgedArrayRef /*DiagnosticInfo::FixIt*/ bridgedFixIts) {
34+
auto *D = getDiagnosticEngine(bridgedEngine);
2535

2636
auto diagID = static_cast<DiagID>(bridgedDiagID);
2737
SmallVector<DiagnosticArgument, 2> arguments;
2838
for (auto arg : getArrayRef<DiagnosticArgument>(bridgedArguments)) {
2939
arguments.push_back(arg);
3040
}
31-
auto inflight = engine.diagnose(loc, diagID, arguments);
41+
auto inflight = D->diagnose(loc, diagID, arguments);
3242

3343
// Add highlight.
3444
if (highlight.isValid()) {
@@ -42,3 +52,8 @@ void DiagnosticEngine_diagnose(
4252
inflight.fixItReplaceChars(range.getStart(), range.getEnd(), text);
4353
}
4454
}
55+
56+
bool DiagnosticEngine_hadAnyError(BridgedDiagnosticEngine bridgedEngine) {
57+
auto *D = getDiagnosticEngine(bridgedEngine);
58+
return D->hadAnyError();
59+
}

lib/ClangImporter/ImportDecl.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,9 +2681,25 @@ namespace {
26812681
if (!result)
26822682
return nullptr;
26832683

2684-
if (auto classDecl = dyn_cast<ClassDecl>(result))
2684+
if (auto classDecl = dyn_cast<ClassDecl>(result)) {
26852685
validateForeignReferenceType(decl, classDecl);
26862686

2687+
auto ctx = Impl.SwiftContext.getSwift58Availability();
2688+
if (!ctx.isAlwaysAvailable()) {
2689+
assert(ctx.getOSVersion().hasLowerEndpoint());
2690+
auto AvAttr = new (Impl.SwiftContext) AvailableAttr(
2691+
SourceLoc(), SourceRange(),
2692+
targetPlatform(Impl.SwiftContext.LangOpts), "", "",
2693+
/*RenameDecl=*/nullptr, ctx.getOSVersion().getLowerEndpoint(),
2694+
/*IntroducedRange=*/SourceRange(), {},
2695+
/*DeprecatedRange=*/SourceRange(), {},
2696+
/*ObsoletedRange=*/SourceRange(),
2697+
PlatformAgnosticAvailabilityKind::None, /*Implicit=*/false,
2698+
false);
2699+
classDecl->getAttrs().add(AvAttr);
2700+
}
2701+
}
2702+
26872703
// If this module is declared as a C++ module, try to synthesize
26882704
// conformances to Swift protocols from the Cxx module.
26892705
auto clangModule = decl->getOwningModule();

lib/Parse/Lexer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
#include "swift/Parse/Lexer.h"
18+
#include "swift/AST/BridgingUtils.h"
1819
#include "swift/AST/DiagnosticsParse.h"
1920
#include "swift/AST/Identifier.h"
2021
#include "swift/Basic/LangOptions.h"
@@ -2084,7 +2085,7 @@ const char *Lexer::tryScanRegexLiteral(const char *TokStart, bool MustBeRegex,
20842085
// recovered from.
20852086
auto *Ptr = TokStart;
20862087
CompletelyErroneous = regexLiteralLexingFn(
2087-
&Ptr, BufferEnd, MustBeRegex, Diags);
2088+
&Ptr, BufferEnd, MustBeRegex, getBridgedOptionalDiagnosticEngine(Diags));
20882089

20892090
// If we didn't make any lexing progress, this isn't a regex literal and we
20902091
// should fallback to lexing as something else.

lib/Parse/ParseRegex.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#include "swift/AST/BridgingUtils.h"
18+
#include "swift/AST/DiagnosticsParse.h"
1719
#include "swift/Basic/BridgingUtils.h"
1820
#include "swift/Parse/Parser.h"
1921

@@ -42,7 +44,8 @@ ParserResult<Expr> Parser::parseExprRegexLiteral() {
4244
regexLiteralParsingFn(regexText.str().c_str(), &version,
4345
/*captureStructureOut*/ capturesBuf.data(),
4446
/*captureStructureSize*/ capturesBuf.size(),
45-
/*diagBaseLoc*/ Tok.getLoc(), Diags);
47+
/*diagBaseLoc*/ Tok.getLoc(),
48+
getBridgedDiagnosticEngine(&Diags));
4649
auto loc = consumeToken();
4750
SourceMgr.recordRegexLiteralStartLoc(loc);
4851

test/Interop/Cxx/foreign-reference/base-class-layout-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -module-name=test | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -module-name=test -disable-availability-checking | %FileCheck %s
22

33
import MemberLayout
44

test/Interop/Cxx/foreign-reference/move-only-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/foreign-reference/move-only-silgen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

@@ -30,6 +30,6 @@ public func test() {
3030
_ = x.test()
3131
}
3232

33-
// CHECK-LABEL: sil [clang MoveOnly.create] @{{_ZN8MoveOnly6createEv|\?create\@MoveOnly\@\@SAPEAU1\@XZ}} : $@convention(c) () -> MoveOnly
33+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang MoveOnly.create] @{{_ZN8MoveOnly6createEv|\?create\@MoveOnly\@\@SAPEAU1\@XZ}} : $@convention(c) () -> MoveOnly
3434

35-
// CHECK-LABEL: sil [clang MoveOnly.test] @{{_ZNK8MoveOnly4testEv|\?test\@MoveOnly\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed MoveOnly) -> Int32
35+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang MoveOnly.test] @{{_ZNK8MoveOnly4testEv|\?test\@MoveOnly\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed MoveOnly) -> Int32

test/Interop/Cxx/foreign-reference/move-only.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify)
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -Xfrontend -disable-availability-checking)
22
//
33
// REQUIRES: executable_test
44

test/Interop/Cxx/foreign-reference/nullable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -g)
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -g -Xfrontend -disable-availability-checking)
22
//
33
// REQUIRES: executable_test
44

test/Interop/Cxx/foreign-reference/pod-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-ide-test -print-module -module-to-print=POD -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop -target %target-arch-apple-macos11 | %FileCheck %s
2+
3+
// REQUIRES: OS=macosx
4+
5+
// CHECK: @available(macOS 13.3.0, *)
6+
// CHECK-NEXT: class Empty {
7+
8+
// CHECK: @available(macOS 13.3.0, *)
9+
// CHECK-NEXT: class MultipleAttrs {

test/Interop/Cxx/foreign-reference/pod-silgen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

@@ -36,6 +36,6 @@ public func test() {
3636
_ = x.test()
3737
}
3838

39-
// CHECK-LABEL: sil [clang IntPair.create] @{{_ZN7IntPair6createEv|\?create\@IntPair\@\@SAPEAU1\@XZ}} : $@convention(c) () -> IntPair
39+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang IntPair.create] @{{_ZN7IntPair6createEv|\?create\@IntPair\@\@SAPEAU1\@XZ}} : $@convention(c) () -> IntPair
4040

41-
// CHECK-LABEL: sil [clang IntPair.test] @{{_ZNK7IntPair4testEv|\?test\@IntPair\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed IntPair) -> Int32
41+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang IntPair.test] @{{_ZNK7IntPair4testEv|\?test\@IntPair\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed IntPair) -> Int32

test/Interop/Cxx/foreign-reference/pod.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -g)
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -g -Xfrontend -disable-availability-checking)
22
//
33
// REQUIRES: executable_test
44
// XFAIL: OS=windows-msvc

test/Interop/Cxx/foreign-reference/reference-counted-silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/foreign-reference/singleton-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

test/Interop/Cxx/foreign-reference/singleton-silgen.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop -disable-availability-checking | %FileCheck %s
22
//
33
// XFAIL: OS=linux-android, OS=linux-androideabi
44

@@ -36,8 +36,8 @@ public func test() {
3636
mutateIt(x)
3737
}
3838

39-
// CHECK-LABEL: sil [clang DeletedSpecialMembers.create] @{{_ZN21DeletedSpecialMembers6createEv|\?create\@DeletedSpecialMembers\@\@SAPEAU1\@XZ}} : $@convention(c) () -> DeletedSpecialMembers
39+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang DeletedSpecialMembers.create] @{{_ZN21DeletedSpecialMembers6createEv|\?create\@DeletedSpecialMembers\@\@SAPEAU1\@XZ}} : $@convention(c) () -> DeletedSpecialMembers
4040

41-
// CHECK-LABEL: sil [clang DeletedSpecialMembers.test] @{{_ZNK21DeletedSpecialMembers4testEv|\?test\@DeletedSpecialMembers\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed DeletedSpecialMembers) -> Int32
41+
// CHECK-LABEL: sil{{ \[available .*\] | }}[clang DeletedSpecialMembers.test] @{{_ZNK21DeletedSpecialMembers4testEv|\?test\@DeletedSpecialMembers\@\@QEBAHXZ}} : $@convention(cxx_method) (@in_guaranteed DeletedSpecialMembers) -> Int32
4242

43-
// CHECK-LABEL: sil [serialized] [clang mutateIt] @{{_Z8mutateItR21DeletedSpecialMembers|\?mutateIt\@\@YAXAEAUDeletedSpecialMembers\@\@\@Z}} : $@convention(c) (DeletedSpecialMembers) -> ()
43+
// CHECK-LABEL: sil{{ \[available .*\] | }}[serialized] [clang mutateIt] @{{_Z8mutateItR21DeletedSpecialMembers|\?mutateIt\@\@YAXAEAUDeletedSpecialMembers\@\@\@Z}} : $@convention(c) (DeletedSpecialMembers) -> ()

test/Interop/Cxx/foreign-reference/singleton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify)
1+
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -enable-experimental-cxx-interop -Xfrontend -validate-tbd-against-ir=none -Xfrontend -disable-llvm-verify -Xfrontend -disable-availability-checking)
22
//
33
// REQUIRES: executable_test
44

test/Interop/Cxx/foreign-reference/unimportable-member-layout-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -module-name=test | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -module-name=test -disable-availability-checking | %FileCheck %s
22

33
import MemberLayout
44

0 commit comments

Comments
 (0)