Skip to content

Commit 3ee8272

Browse files
authored
Merge pull request #74942 from swiftlang/gaborh/emit-implicit-std-dependencies-all-public
[cxx-interop] Emit Swift StdLib dependencies when all public decls emitted
2 parents 2d3d670 + c3a02cd commit 3ee8272

File tree

45 files changed

+61
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+61
-62
lines changed

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,9 @@ bool swift::printAsClangHeader(raw_ostream &os, ModuleDecl *M,
624624
!frontendOpts.ClangHeaderExposedDecls.has_value() ||
625625
*frontendOpts.ClangHeaderExposedDecls ==
626626
FrontendOptions::ClangHeaderExposeBehavior::
627-
HasExposeAttrOrImplicitDeps;
627+
HasExposeAttrOrImplicitDeps ||
628+
*frontendOpts.ClangHeaderExposedDecls ==
629+
FrontendOptions::ClangHeaderExposeBehavior::AllPublic;
628630

629631
std::string moduleContentsBuf;
630632
llvm::raw_string_ostream moduleContents{moduleContentsBuf};

test/Interop/SwiftToCxx/class/swift-class-virtual-method-dispatch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Class -clang-header-expose-decls=all-public -emit-clang-header-path %t/class.h
33
// RUN: %FileCheck %s < %t/class.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/class.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/class.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// UNSUPPORTED: CPU=arm64e
88

test/Interop/SwiftToCxx/class/swift-resilient-class-virtual-method-dispatch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %S/swift-class-virtual-method-dispatch.swift -typecheck -module-name Class -clang-header-expose-decls=all-public -emit-clang-header-path %t/class.h -enable-library-evolution
33
// RUN: %FileCheck %s < %t/class.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/class.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/class.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// note: implemented in swift-class-virtual-method-dispatch.swift
88

test/Interop/SwiftToCxx/class/swift-subclass-of-resilient-class-virtual-method-dispatch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: echo '#include "class.h"' > %t/fixed-useclass.h
1010
// RUN: cat %t/useclass.h >> %t/fixed-useclass.h
1111

12-
// RUN: %check-interop-cxx-header-in-clang(%t/fixed-useclass.h)
12+
// RUN: %check-interop-cxx-header-in-clang(%t/fixed-useclass.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1313

1414
// rdar://105396625
1515
// UNSUPPORTED: CPU=arm64e

test/Interop/SwiftToCxx/cross-module-refs/do-not-expose-imported-api-by-default.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: %target-swift-frontend %s -typecheck -module-name UsesStructs -I %t -clang-header-expose-decls=all-public -emit-clang-header-path %t/uses-structs.h
55

6-
// RUN: %check-interop-cxx-header-in-clang(%t/uses-structs.h)
6+
// RUN: %check-interop-cxx-header-in-clang(%t/uses-structs.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
77
// RUN: %FileCheck %s < %t/uses-structs.h
88

99
import Structs

test/Interop/SwiftToCxx/cross-module-refs/imported-struct-refs-in-cxx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// RUN: %target-swift-frontend %s -typecheck -module-name UsesStructs -I %t -clang-header-expose-decls=all-public -emit-clang-header-path %t/uses-structs.h -clang-header-expose-module Structs=structs.h
55

66
// RUN: %FileCheck %s < %t/uses-structs.h
7-
// RUN: %check-interop-cxx-header-in-clang(-I %t %t/uses-structs.h)
7+
// RUN: %check-interop-cxx-header-in-clang(-I %t %t/uses-structs.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
88

99
// RUN: %target-swift-frontend %s -typecheck -module-name UsesStructs -I %t -cxx-interoperability-mode=default -emit-clang-header-path %t/uses-structs-default.h -clang-header-expose-module Structs=structs.h
10-
// RUN: %check-interop-cxx-header-in-clang(-I %t %t/uses-structs-default.h)
10+
// RUN: %check-interop-cxx-header-in-clang(-I %t %t/uses-structs-default.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1111

1212
import Structs
1313

test/Interop/SwiftToCxx/enums/enum-associated-value-class-type-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums.h
33
// RUN: %FileCheck %s < %t/enums.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// rdar://124466216
88
// UNSUPPORTED: OS=watchos

test/Interop/SwiftToCxx/enums/enum-element-method-name-clash.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extension Foo {
2525

2626
// CHECK-NOT: Foo bar(swift::Int version)
2727

28+
// CHECK: class SWIFT_SYMBOL("s:5Enums3FooO") Foo final {
2829
// CHECK: switch (_getEnumTag()) {
2930
// CHECK-NEXT: case 0: return cases::bar;
3031
// CHECK-NEXT: default: abort();

test/Interop/SwiftToCxx/enums/enum-member-param-no-shadow-case.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums.h
33
// RUN: %FileCheck %s < %t/enums.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public enum E {
88
case a

test/Interop/SwiftToCxx/enums/large-enums-pass-return-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums.h
33
// RUN: %FileCheck %s < %t/enums.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public struct IntTuple {
88
let values: (Int64, Int64, Int64, Int64, Int64, Int64)

test/Interop/SwiftToCxx/enums/resilient-enum-in-cxx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// RUN: %target-swift-frontend %s -enable-library-evolution -D NEW_CASE -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums_new_case.h
77
// RUN: %FileCheck --check-prefixes=CHECK,NEW_CASE %s < %t/enums_new_case.h
88

9-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
10-
// RUN: %check-interop-cxx-header-in-clang(%t/enums_new_case.h -Wno-unused-private-field -Wno-unused-function)
9+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
10+
// RUN: %check-interop-cxx-header-in-clang(%t/enums_new_case.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1111

1212
public enum Foo {
1313
case a(Double)

test/Interop/SwiftToCxx/enums/small-enums-generated-stub-64bit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums.h
33
// RUN: %FileCheck %s < %t/enums.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// REQUIRES: PTRSIZE=64
88

test/Interop/SwiftToCxx/enums/swift-enum-implementation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -clang-header-expose-decls=all-public -emit-clang-header-path %t/enums.h
33
// RUN: %FileCheck %s < %t/enums.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/enums.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// RUN: %target-swift-frontend %s -typecheck -module-name Enums -enable-experimental-cxx-interop -emit-clang-header-path %t/enums-default.h
88
// RUN: %FileCheck %s < %t/enums-default.h

test/Interop/SwiftToCxx/extension/struct-extension-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Structs -clang-header-expose-decls=all-public -emit-clang-header-path %t/structs.h
33
// RUN: %FileCheck %s < %t/structs.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/structs.h -Wno-unused-private-field -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/structs.h -Wno-unused-private-field -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77

88
public struct TypeAfterArray {

test/Interop/SwiftToCxx/functions/cdecl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name CdeclFunctions -clang-header-expose-decls=all-public -emit-clang-header-path %t/cdecl.h
33
// RUN: %FileCheck %s < %t/cdecl.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/cdecl.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/cdecl.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK-LABEL: namespace CdeclFunctions SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("CdeclFunctions") {
88

test/Interop/SwiftToCxx/functions/swift-function-argument-keyword-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK: SWIFT_INLINE_THUNK void testKeywordArgument(swift::Int register_) noexcept
88
// CHECK-NEXT: _impl::$s9Functions19testKeywordArgument8registerySi_tF(register_);

test/Interop/SwiftToCxx/functions/swift-function-overloads.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public func overloadedFunc(_ x: Int) { }
88
public func overloadedFunc(_ y: Float) { }

test/Interop/SwiftToCxx/functions/swift-function-unsupported-cxx-type.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public func a() { }
88
public func b(_ x: @escaping (Int) -> ()) { }

test/Interop/SwiftToCxx/functions/swift-functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import CxxStdlib
66

7-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
7+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
88

99
@_cdecl("cdeclFunction") public func cdeclFunction(_ x: CInt) {}
1010

test/Interop/SwiftToCxx/functions/swift-operators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Operators -clang-header-expose-decls=all-public -emit-clang-header-path %t/operators.h
33
// RUN: %FileCheck %s < %t/operators.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/operators.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/operators.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK-LABEL: namespace Operators SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("Operators") {
88

test/Interop/SwiftToCxx/functions/swift-primitive-functions-cxx-bridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s -check-prefix CHECK -check-prefix CHECK-%target-abi < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK: SWIFT_INLINE_THUNK float passThrougCFloat(float x) noexcept SWIFT_SYMBOL({{.*}}) SWIFT_WARN_UNUSED_RESULT {
88
// CHECK-NEXT: return _impl::$s9Functions16passThrougCFloatyS2fF(x);

test/Interop/SwiftToCxx/functions/swift-primitive-inout-functions-cxx-bridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK: SWIFT_EXTERN void $s9Functions8inOutIntyySizF(ptrdiff_t * _Nonnull x) SWIFT_NOEXCEPT SWIFT_CALL; // inOutInt(_:)
88
// CHECK: SWIFT_EXTERN void $s9Functions11inOutTwoIntyySiz_SiztF(ptrdiff_t * _Nonnull x, ptrdiff_t * _Nonnull y) SWIFT_NOEXCEPT SWIFT_CALL; // inOutTwoInt(_:_:)

test/Interop/SwiftToCxx/functions/swift-transparent-functions-cxx-bridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// CHECK: SWIFT_EXTERN ptrdiff_t $s9Functions24transparentPrimitiveFuncyS2iF(ptrdiff_t x) SWIFT_NOEXCEPT SWIFT_CALL; // transparentPrimitiveFunc(_:)
88

test/Interop/SwiftToCxx/generics/generic-enum-in-cxx.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
33
// RUN: %FileCheck %s < %t/generics.h
4-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
4+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
55

66
// RUN: %empty-directory(%t)
77
// RUN: %target-swift-frontend %s -enable-library-evolution -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
88
// RUN: %FileCheck %s < %t/generics.h
9-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
9+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1010

1111
// FIXME: remove the need for -Wno-reserved-identifier
1212

@@ -89,6 +89,8 @@ public func inoutConcreteOpt(_ x: inout GenericOpt<UInt16>) {
8989
}
9090
}
9191

92+
// CHECK: namespace Generics SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("Generics") {
93+
9294
// CHECK: template<class T_0_0>
9395
// CHECK-NEXT: #ifdef __cpp_concepts
9496
// CHECK-NEXT: requires swift::isUsableInGenericContext<T_0_0>

test/Interop/SwiftToCxx/generics/generic-function-in-cxx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions.h
33
// RUN: %FileCheck %s < %t/functions.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// RUN: %target-swift-frontend %s -typecheck -module-name Functions -enable-library-evolution -clang-header-expose-decls=all-public -emit-clang-header-path %t/functions-evo.h
88
// RUN: %FileCheck %s < %t/functions-evo.h
99

10-
// RUN: %check-interop-cxx-header-in-clang(%t/functions-evo.h -Wno-unused-function)
10+
// RUN: %check-interop-cxx-header-in-clang(%t/functions-evo.h -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1111

1212
public func genericPrintFunctionTwoArg<T>(_ x: T, _ y: Int) {
1313
print("X:", x)

test/Interop/SwiftToCxx/generics/generic-struct-in-cxx.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
33
// RUN: %FileCheck %s < %t/generics.h
4-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
4+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
55

66
// Check that an instantiation compiles too.
77
// RUN: echo "constexpr int x = sizeof(Generics::GenericPair<int, int>);" >> %t/generics.h
8-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
8+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
99

1010
// RUN: %empty-directory(%t)
1111
// RUN: %target-swift-frontend %s -enable-library-evolution -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
1212
// RUN: %FileCheck %s < %t/generics.h
13-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
13+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1414

1515
// FIXME: remove the need for -Wno-reserved-identifier
1616

test/Interop/SwiftToCxx/generics/generic-struct-known-layout-direct-in-cxx.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %S/generic-struct-in-cxx.swift -D KNOWN_LAYOUT -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
33
// RUN: %FileCheck %s < %t/generics.h
4-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
4+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
55

66
// RUN: %empty-directory(%t)
77
// RUN: %target-swift-frontend %S/generic-struct-in-cxx.swift -D KNOWN_LAYOUT -enable-library-evolution -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
88
// RUN: %FileCheck %s < %t/generics.h
9-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
9+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1010

11+
// CHECK: namespace Generics SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("Generics") {
1112
// CHECK: // Stub struct to be used to pass/return values to/from Swift functions.
1213
// CHECK-NEXT: struct swift_interop_passStub_Generics_[[PTRPTRENC:void_ptr_[0-9]_[0-9]_void_ptr_[0-9]_[0-9]+]] {
1314
// CHECK-NEXT: void * _Nullable _1;

test/Interop/SwiftToCxx/generics/generic-struct-known-layout-indirect-in-cxx.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %S/generic-struct-in-cxx.swift -D KNOWN_LAYOUT -D INDIRECT_KNOWN_LAYOUT -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
33
// RUN: %FileCheck %s < %t/generics.h
4-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
4+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
55

66
// RUN: %empty-directory(%t)
77
// RUN: %target-swift-frontend %S/generic-struct-in-cxx.swift -D KNOWN_LAYOUT -D INDIRECT_KNOWN_LAYOUT -enable-library-evolution -typecheck -module-name Generics -clang-header-expose-decls=all-public -emit-clang-header-path %t/generics.h
88
// RUN: %FileCheck %s < %t/generics.h
9-
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier)
9+
// RUN: %check-interop-cxx-header-in-clang(%t/generics.h -Wno-reserved-identifier -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
1010

1111
// CHECK: SWIFT_EXTERN void $s8Generics11GenericPairV1yq_vg(SWIFT_INDIRECT_RESULT void * _Nonnull, void * _Nonnull , SWIFT_CONTEXT const void * _Nonnull _self) SWIFT_NOEXCEPT SWIFT_CALL; // _
1212
// CHECK-NEXT: SWIFT_EXTERN void $s8Generics11GenericPairV1yq_vs(const void * _Nonnull newValue, void * _Nonnull , SWIFT_CONTEXT void * _Nonnull _self) SWIFT_NOEXCEPT SWIFT_CALL; // _

test/Interop/SwiftToCxx/initializers/init-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Init -clang-header-expose-decls=all-public -emit-clang-header-path %t/inits.h
33
// RUN: %FileCheck %s < %t/inits.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/inits.h -Wno-unused-function)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/inits.h -Wno-unused-function -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
// RUN: %target-swift-frontend %s -typecheck -module-name Init -clang-header-expose-decls=all-public -swift-version 5 -emit-clang-header-path %t/inits2.h
88
// RUN: %FileCheck %s < %t/inits2.h

test/Interop/SwiftToCxx/initializers/swift-init-availability-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Methods -clang-header-expose-decls=all-public -emit-clang-header-path %t/methods.h
33
// RUN: %FileCheck %s < %t/methods.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public struct Struct {
88
var field: Int16

test/Interop/SwiftToCxx/methods/method-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Methods -clang-header-expose-decls=all-public -emit-clang-header-path %t/methods.h
33
// RUN: %FileCheck %s < %t/methods.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public struct LargeStruct {
88
let x1, x2, x3, x4, x5, x6: Int

test/Interop/SwiftToCxx/methods/mutating-method-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Methods -clang-header-expose-decls=all-public -emit-clang-header-path %t/methods.h
33
// RUN: %FileCheck %s < %t/methods.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public struct LargeStruct {
88
var x1, x2, x3, x4, x5, x6: Int

test/Interop/SwiftToCxx/methods/swift-method-availability-in-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend %s -typecheck -module-name Methods -clang-header-expose-decls=all-public -emit-clang-header-path %t/methods.h
33
// RUN: %FileCheck %s < %t/methods.h
44

5-
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h)
5+
// RUN: %check-interop-cxx-header-in-clang(%t/methods.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY)
66

77
public struct Struct {
88
var field: Int16

0 commit comments

Comments
 (0)