Skip to content

Commit 985db63

Browse files
committed
[tests] Update tests based on new template name importing rules.
1 parent f9e111c commit 985db63

24 files changed

+102
-103
lines changed

test/Interop/Cxx/namespace/class-inline-namespace-irgen.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension Parent.TypedefInInlineChild {
4848
return ""
4949
}
5050
}
51-
// CHECK: define hidden swiftcc {{.*}} @"$sSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11b7Child21e2InbC4IcEEV4testE6stringSSvg"()
51+
// CHECK: define hidden swiftcc {{.*}} @"$sSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbV4testE6stringSSvg"()
5252

5353
extension Parent.InInlineChild {
5454
func doSomething() {
@@ -70,22 +70,22 @@ extension Parent.InlineChild.InSecondInlineChild {
7070
}
7171
// define hidden swiftcc {{.*}} @"$sSo6ParentO11InlineChildO06SecondbC0O02IndbC0V4testE1ySivg"()
7272

73-
// CHECK: define hidden swiftcc {{.*}} @"$s4test3useySSSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11d7Child21g2IndE4IcEEVF"()
74-
// CHECK: call swiftcc {{.*}} @"$sSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11b7Child21e2InbC4IcEEV4testE6stringSSvg"
73+
// CHECK: define hidden swiftcc {{.*}} @"$s4test3useySSSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbVF"()
74+
// CHECK: call swiftcc {{.*}} @"$sSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbV4testE6stringSSvg"
7575
func use(_ x: Parent.TypedefInInlineChild) -> String {
7676
let s = x.string
7777
return s
7878
}
7979

80-
// CHECK: define hidden swiftcc {{.*}} @"$s4test4use2ySSSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11d7Child21g2IndE4IcEEVF"()
81-
// CHECK: call swiftcc {{.*}} @"$sSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11b7Child21e2InbC4IcEEV4testE6stringSSvg"
80+
// CHECK: define hidden swiftcc {{.*}} @"$s4test4use2ySSSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbVF"()
81+
// CHECK: call swiftcc {{.*}} @"$sSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbV4testE6stringSSvg"
8282
func use2(_ x: Parent.InlineChild.TypedefInInlineChild) -> String {
8383
let s = x.string
8484
return s
8585
}
8686

8787
// define swiftcc void @"$s4testAAyySo6ParentO11InlineChildO02IncD0VF"()
88-
// CHECK: alloca %TSo6ParentO11InlineChildO027__CxxTemplateInstN6Parent11b7Child21e2InbC4IcEEV
88+
// CHECK: alloca %TSo6ParentO11InlineChildO0033TemplateInInlineChildInt8_ehGIixbV
8989
// CHECK: call {{.*}} @{{_ZN6Parent11InlineChild21TemplateInInlineChildIcEC|"\?\?0\?\$TemplateInInlineChild@D@InlineChild@Parent@@QEAA@XZ"}}
9090
// CHECK: call swiftcc void @"$sSo6ParentO11InlineChildO02InbC0V4testE11doSomethingyyF"(
9191
// CHECK: call swiftcc {{.*}} @"$sSo6ParentO11InlineChildO06SecondbC0O02IndbC0V4testE1xSivg"(

test/Interop/Cxx/namespace/templates-module-interface.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,59 @@
33
// CHECK: enum TemplatesNS1 {
44
// CHECK-NEXT: enum TemplatesNS2 {
55
// CHECK-NEXT: static func forwardDeclaredFunctionTemplate<T>(_: T) -> UnsafePointer<CChar>!
6-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS112TemplatesNS228ForwardDeclaredClassTemplateIcEE {
6+
// CHECK-NEXT: struct ForwardDeclaredClassTemplate<Int8> {
77
// CHECK-NEXT: init()
88
// CHECK-NEXT: mutating func basicMember() -> UnsafePointer<CChar>!
99
// CHECK-NEXT: }
1010
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
1111
// CHECK-NEXT: struct ForwardDeclaredClassTemplate<> {
1212
// CHECK-NEXT: }
1313
// CHECK-NEXT: static func forwardDeclaredFunctionTemplateOutOfLine<T>(_: T) -> UnsafePointer<CChar>!
14-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS112TemplatesNS237ForwardDeclaredClassTemplateOutOfLineIcEE {
14+
// CHECK-NEXT: struct ForwardDeclaredClassTemplateOutOfLine<Int8> {
1515
// CHECK-NEXT: init()
1616
// CHECK-NEXT: mutating func basicMember() -> UnsafePointer<CChar>!
1717
// CHECK-NEXT: }
1818
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
1919
// CHECK-NEXT: struct ForwardDeclaredClassTemplateOutOfLine<> {
2020
// CHECK-NEXT: }
21-
// CHECK-NEXT: typealias BasicClassTemplateChar = TemplatesNS1.TemplatesNS3.__CxxTemplateInstN12TemplatesNS112TemplatesNS318BasicClassTemplateIcEE
21+
// CHECK-NEXT: typealias BasicClassTemplateChar = TemplatesNS1.TemplatesNS3.BasicClassTemplate<Int8>
2222
// CHECK-NEXT: static func takesClassTemplateFromSibling(_: TemplatesNS1.TemplatesNS2.BasicClassTemplateChar) -> UnsafePointer<CChar>!
2323
// CHECK-NEXT: }
2424
// CHECK-NEXT: static func basicFunctionTemplate<T>(_: T) -> UnsafePointer<CChar>!
25-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS118BasicClassTemplateIcEE {
25+
// CHECK-NEXT: struct BasicClassTemplate<Int8> {
2626
// CHECK-NEXT: init()
2727
// CHECK-NEXT: mutating func basicMember() -> UnsafePointer<CChar>!
2828
// CHECK-NEXT: }
2929
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
3030
// CHECK-NEXT: struct BasicClassTemplate<> {
3131
// CHECK-NEXT: }
32-
// CHECK-NEXT: typealias BasicClassTemplateChar = TemplatesNS1.__CxxTemplateInstN12TemplatesNS118BasicClassTemplateIcEE
32+
// CHECK-NEXT: typealias BasicClassTemplateChar = TemplatesNS1.BasicClassTemplate<Int8>
3333
// CHECK-NEXT: static func basicFunctionTemplateDefinedInDefs<T>(_: T) -> UnsafePointer<CChar>!
3434
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
3535
// CHECK-NEXT: struct BasicClassTemplateDefinedInDefs<> {
3636
// CHECK-NEXT: }
37-
// CHECK-NEXT: typealias UseTemplate = TemplatesNS4.__CxxTemplateInstN12TemplatesNS417HasSpecializationIcEE
38-
// CHECK-NEXT: typealias UseSpecialized = TemplatesNS4.__CxxTemplateInstN12TemplatesNS417HasSpecializationIiEE
37+
// CHECK-NEXT: typealias UseTemplate = TemplatesNS4.HasSpecialization<Int8>
38+
// CHECK-NEXT: typealias UseSpecialized = TemplatesNS4.HasSpecialization<Int32>
3939
// CHECK-NEXT: enum TemplatesNS3 {
40-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS112TemplatesNS318BasicClassTemplateIcEE {
40+
// CHECK-NEXT: struct BasicClassTemplate<Int8> {
4141
// CHECK-NEXT: init()
4242
// CHECK-NEXT: }
4343
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
4444
// CHECK-NEXT: struct BasicClassTemplate<> {
4545
// CHECK-NEXT: }
4646
// CHECK-NEXT: }
47-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS112TemplatesNS228ForwardDeclaredClassTemplateIcEE {
47+
// CHECK-NEXT: struct ForwardDeclaredClassTemplate<Int8> {
4848
// CHECK-NEXT: init()
4949
// CHECK-NEXT: mutating func basicMember() -> UnsafePointer<CChar>!
5050
// CHECK-NEXT: }
51-
// CHECK-NEXT: typealias ForwardDeclaredClassTemplateChar = TemplatesNS1.TemplatesNS2.__CxxTemplateInstN12TemplatesNS112TemplatesNS228ForwardDeclaredClassTemplateIcEE
51+
// CHECK-NEXT: typealias ForwardDeclaredClassTemplateChar = TemplatesNS1.TemplatesNS2.ForwardDeclaredClassTemplate<Int8>
5252
// CHECK-NEXT: }
53-
// CHECK-NEXT: typealias ForwardDeclaredClassTemplateOutOfLineChar = TemplatesNS1.TemplatesNS2.__CxxTemplateInstN12TemplatesNS112TemplatesNS237ForwardDeclaredClassTemplateOutOfLineIcEE
53+
// CHECK-NEXT: typealias ForwardDeclaredClassTemplateOutOfLineChar = TemplatesNS1.TemplatesNS2.ForwardDeclaredClassTemplateOutOfLine<Int8>
5454
// CHECK-NEXT: enum TemplatesNS4 {
55-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS417HasSpecializationIcEE {
55+
// CHECK-NEXT: struct HasSpecialization<Int8> {
5656
// CHECK-NEXT: init()
5757
// CHECK-NEXT: }
58-
// CHECK-NEXT: struct __CxxTemplateInstN12TemplatesNS417HasSpecializationIiEE {
58+
// CHECK-NEXT: struct HasSpecialization<Int32> {
5959
// CHECK-NEXT: init()
6060
// CHECK-NEXT: }
6161
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")

test/Interop/Cxx/namespace/templates-second-header-module-interface.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
// CHECK: enum TemplatesNS1 {
44
// CHECK: static func basicFunctionTemplateDefinedInDefs<T>(_: T) -> UnsafePointer<CChar>!
5-
// CHECK: struct __CxxTemplateInstN12TemplatesNS131BasicClassTemplateDefinedInDefsIcEE {
5+
// CHECK: struct BasicClassTemplateDefinedInDefs<Int8> {
66
// CHECK: init()
77
// CHECK: mutating func basicMember() -> UnsafePointer<CChar>!
88
// CHECK: }
99
// CHECK: }
1010

11-
// CHECK: typealias BasicClassTemplateDefinedInDefsChar = TemplatesNS1.__CxxTemplateInstN12TemplatesNS131BasicClassTemplateDefinedInDefsIcEE
11+
// CHECK: typealias BasicClassTemplateDefinedInDefsChar = TemplatesNS1.BasicClassTemplateDefinedInDefs<Int8>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// RUN: %target-swift-ide-test -print-module -module-to-print=TemplatesWithForwardDecl -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
22

33
// CHECK: enum NS1 {
4-
// CHECK-NEXT: struct __CxxTemplateInstN3NS115ForwardDeclaredIiEE {
4+
// CHECK-NEXT: struct ForwardDeclared<Int32> {
55
// CHECK-NEXT: init()
66
// CHECK-NEXT: }
77
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
88
// CHECK-NEXT: struct ForwardDeclared<T> {
99
// CHECK-NEXT: }
10-
// CHECK-NEXT: struct __CxxTemplateInstN3NS14DeclIiEE {
10+
// CHECK-NEXT: struct Decl<Int32> {
1111
// CHECK-NEXT: init()
12-
// CHECK-NEXT: init(fwd: NS1.__CxxTemplateInstN3NS115ForwardDeclaredIiEE)
12+
// CHECK-NEXT: init(fwd: NS1.ForwardDeclared<Int32>)
1313
// CHECK-NEXT: typealias MyInt = Int32
14-
// CHECK-NEXT: var fwd: NS1.__CxxTemplateInstN3NS115ForwardDeclaredIiEE
15-
// CHECK-NEXT: static let intValue: NS1.__CxxTemplateInstN3NS14DeclIiEE.MyInt
14+
// CHECK-NEXT: var fwd: NS1.ForwardDeclared<Int32>
15+
// CHECK-NEXT: static let intValue: NS1.Decl<Int32>.MyInt
1616
// CHECK-NEXT: }
1717
// CHECK-NEXT: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
1818
// CHECK-NEXT: struct Decl<T> {
1919
// CHECK-NEXT: }
20-
// CHECK-NEXT: typealias di = NS1.__CxxTemplateInstN3NS14DeclIiEE
20+
// CHECK-NEXT: typealias di = NS1.Decl<Int32>
2121
// CHECK-NEXT: }

test/Interop/Cxx/operators/member-inline-module-interface.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
// CHECK: struct TemplatedArray<T> {
9595
// CHECK: }
96-
// CHECK: struct __CxxTemplateInst14TemplatedArrayIdE {
96+
// CHECK: struct TemplatedArray<Double> {
9797
// CHECK: subscript(i: Int32) -> Double
9898

9999
// CHECK: @available(*, unavailable, message: "use subscript")
@@ -102,7 +102,7 @@
102102
// CHECK: @available(*, unavailable, message: "use subscript")
103103
// CHECK: func __operatorSubscriptConst(_ i: Int32) -> UnsafePointer<Double>
104104
// CHECK: }
105-
// CHECK: typealias TemplatedDoubleArray = __CxxTemplateInst14TemplatedArrayIdE
105+
// CHECK: typealias TemplatedDoubleArray = TemplatedArray<Double>
106106

107107

108108
// CHECK: struct TemplatedSubscriptArray {
@@ -139,12 +139,12 @@
139139

140140
// CHECK: struct TemplatedArrayByVal<T> {
141141
// CHECK: }
142-
// CHECK: struct __CxxTemplateInst19TemplatedArrayByValIdE {
142+
// CHECK: struct TemplatedArrayByVal<Double> {
143143
// CHECK: subscript(i: Int32) -> Double { mutating get }
144144
// CHECK: @available(*, unavailable, message: "use subscript")
145145
// CHECK: mutating func __operatorSubscriptConst(_ i: Int32) -> Double
146146
// CHECK: }
147-
// CHECK: typealias TemplatedDoubleArrayByVal = __CxxTemplateInst19TemplatedArrayByValIdE
147+
// CHECK: typealias TemplatedDoubleArrayByVal = TemplatedArrayByVal<Double>
148148

149149
// CHECK: struct TemplatedByVal<T> {
150150
// CHECK-NEXT: }

test/Interop/Cxx/stdlib/libcxx-module-interface.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
// CHECK-IOSFWD: enum std {
1212
// CHECK-IOSFWD: enum __1 {
13-
// CHECK-IOSFWD: struct __CxxTemplateInstNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE : CxxRandomAccessCollection {
13+
// CHECK-IOSFWD: struct basic_string<Int8, char_traits<Int8>, allocator<Int8>> : CxxRandomAccessCollection {
1414
// CHECK-IOSFWD: typealias value_type = CChar
1515
// CHECK-IOSFWD: }
16-
// CHECK-IOSFWD: struct __CxxTemplateInstNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE : CxxRandomAccessCollection {
16+
// CHECK-IOSFWD: struct basic_string<Scalar, char_traits<Scalar>, allocator<Scalar>> : CxxRandomAccessCollection {
1717
// CHECK-IOSFWD: typealias value_type = CWideChar
1818
// CHECK-IOSFWD: }
19-
// CHECK-IOSFWD: typealias string = std.__1.__CxxTemplateInstNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE
20-
// CHECK-IOSFWD: typealias wstring = std.__1.__CxxTemplateInstNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE
19+
// CHECK-IOSFWD: typealias string = std.__1.basic_string<Int8, char_traits<Int8>, allocator<Int8>>
20+
// CHECK-IOSFWD: typealias wstring = std.__1.basic_string<Scalar, char_traits<Scalar>, allocator<Scalar>>
2121
// CHECK-IOSFWD: }
2222
// CHECK-IOSFWD: }
2323

test/Interop/Cxx/stdlib/overlay/custom-iterator-module-interface.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@
8686
// CHECK-NOT: struct HasNoPreIncrementOperator : UnsafeCxxInputIterator
8787
// CHECK-NOT: struct HasNoDereferenceOperator : UnsafeCxxInputIterator
8888

89-
// CHECK: struct __CxxTemplateInst17TemplatedIteratorIiE : UnsafeCxxInputIterator {
89+
// CHECK: struct TemplatedIterator<Int32> : UnsafeCxxInputIterator {
9090
// CHECK: var pointee: Int32 { get }
91-
// CHECK: func successor() -> __CxxTemplateInst17TemplatedIteratorIiE
91+
// CHECK: func successor() -> TemplatedIterator<Int32>
9292
// CHECK: typealias Pointee = Int32
93-
// CHECK: static func == (lhs: __CxxTemplateInst17TemplatedIteratorIiE, other: __CxxTemplateInst17TemplatedIteratorIiE) -> Bool
93+
// CHECK: static func == (lhs: TemplatedIterator<Int32>, other: TemplatedIterator<Int32>) -> Bool
9494
// CHECK: }
9595

9696
// CHECK: struct __CxxTemplateInst28TemplatedIteratorOutOfLineEqIiE : UnsafeCxxInputIterator {

test/Interop/Cxx/stdlib/overlay/custom-sequence-module-interface.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
// CHECK-NOT: typealias Iterator
5151
// CHECK-NOT: typealias RawIterator
5252
// CHECK: }
53-
// CHECK: struct __CxxTemplateInst20HasTemplatedIteratorIi12NoDefinitionIiEE {
53+
// CHECK: struct HasTemplatedIterator<Int32, NoDefinition<Int32>> {
5454
// CHECK-NOT: typealias Element
5555
// CHECK-NOT: typealias Iterator
5656
// CHECK-NOT: typealias RawIterator
5757
// CHECK: }
58-
// CHECK: typealias HasUninstantiatableIterator = __CxxTemplateInst20HasTemplatedIteratorIi12NoDefinitionIiEE
58+
// CHECK: typealias HasUninstantiatableIterator = HasTemplatedIterator<Int32, NoDefinition<Int32>>

test/Interop/Cxx/templates/canonical-types-module-interface.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-swift-ide-test -print-module -module-to-print=CanonicalTypes -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
22

3-
// CHECK: struct __CxxTemplateInst12MagicWrapperI10IntWrapperE {
3+
// CHECK: struct MagicWrapper<IntWrapper> {
44
// CHECK-NEXT: init()
55
// CHECK-NEXT: init(t: IntWrapper)
66
// CHECK-NEXT: var t: IntWrapper
@@ -12,5 +12,5 @@
1212
// CHECK-NEXT: func getValue() -> Int32
1313
// CHECK-NEXT: var value: Int32
1414
// CHECK-NEXT: }
15-
// CHECK-NEXT: typealias WrappedMagicNumberA = __CxxTemplateInst12MagicWrapperI10IntWrapperE
16-
// CHECK-NEXT: typealias WrappedMagicNumberB = __CxxTemplateInst12MagicWrapperI10IntWrapperE
15+
// CHECK-NEXT: typealias WrappedMagicNumberA = MagicWrapper<IntWrapper>
16+
// CHECK-NEXT: typealias WrappedMagicNumberB = MagicWrapper<IntWrapper>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// RUN: %target-swift-ide-test -print-module -module-to-print=ClassTemplateInNamespace -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
22

33
// CHECK: enum Space {
4-
// CHECK: struct __CxxTemplateInstN5Space4ShipIJFvbEEEE {
4+
// CHECK: struct Ship<_> {
55
// CHECK: init()
66
// CHECK: }
7+
// CHECK: @available(*, unavailable, message: "Un-specialized class templates are not currently supported. Please use a specialization of this type.")
78
// CHECK: struct Ship<> {
89
// CHECK: }
9-
// CHECK: typealias Orbiter = Space.__CxxTemplateInstN5Space4ShipIJFvbEEEE
10+
// CHECK: typealias Orbiter = Space.Ship<_>
1011
// CHECK: }

0 commit comments

Comments
 (0)