File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
test/Interop/Cxx/templates Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,17 @@ struct TemplateInstantiationNamePrinter
137137 Visit (type->getElementType ().getTypePtr ()) + " >" )
138138 .str ();
139139 }
140+
141+ std::string VisitArrayType (const clang::ArrayType *type) {
142+ return (Twine (" [" ) + Visit (type->getElementType ().getTypePtr ()) + " ]" )
143+ .str ();
144+ }
145+
146+ std::string VisitConstantArrayType (const clang::ConstantArrayType *type) {
147+ return (Twine (" Vector<" ) + Visit (type->getElementType ().getTypePtr ()) +
148+ " , " + std::to_string (type->getSExtSize ()) + " >" )
149+ .str ();
150+ }
140151};
141152
142153std::string swift::importer::printClassTemplateSpecializationName (
Original file line number Diff line number Diff line change @@ -19,11 +19,19 @@ typedef MagicWrapper<const long> WrappedMagicLongConst;
1919typedef MagicWrapper<int *> WrappedMagicIntPtr;
2020typedef MagicWrapper<const int *> WrappedMagicIntConstPtr;
2121typedef MagicWrapper<int **> WrappedMagicIntPtrPtr;
22+ typedef MagicWrapper<int []> WrappedMagicIntArr;
23+ typedef MagicWrapper<long []> WrappedMagicLongArr;
24+ typedef MagicWrapper<int [123 ]> WrappedMagicIntFixedSizeArr1;
25+ typedef MagicWrapper<int [124 ]> WrappedMagicIntFixedSizeArr2;
2226
2327typedef DoubleWrapper<MagicWrapper<int >> DoubleWrappedInt;
2428typedef DoubleWrapper<MagicWrapper<const int >> DoubleWrappedIntConst;
2529typedef DoubleWrapper<MagicWrapper<const long >> DoubleWrappedLongConst;
2630typedef DoubleWrapper<MagicWrapper<int *>> DoubleWrappedIntPtr;
2731typedef DoubleWrapper<MagicWrapper<const int *>> DoubleWrappedIntConstPtr;
32+ typedef DoubleWrapper<MagicWrapper<int []>> DoubleWrappedMagicIntArr;
33+ typedef DoubleWrapper<MagicWrapper<long []>> DoubleWrappedMagicLongArr;
34+ typedef DoubleWrapper<MagicWrapper<int [42 ]>> DoubleWrappedMagicIntFixedSizeArr1;
35+ typedef DoubleWrapper<MagicWrapper<int [43 ]>> DoubleWrappedMagicIntFixedSizeArr2;
2836
2937#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H
Original file line number Diff line number Diff line change 1313// CHECK: typealias WrappedMagicIntPtr = MagicWrapper<UnsafeMutablePointer<CInt>>
1414// CHECK: typealias WrappedMagicIntConstPtr = MagicWrapper<UnsafePointer<CInt>>
1515// CHECK: typealias WrappedMagicIntPtrPtr = MagicWrapper<UnsafeMutablePointer<UnsafeMutablePointer<CInt>>>
16+ // CHECK: typealias WrappedMagicIntArr = MagicWrapper<[CInt]>
17+ // CHECK: typealias WrappedMagicLongArr = MagicWrapper<[CLong]>
18+ // CHECK: typealias WrappedMagicIntFixedSizeArr1 = MagicWrapper<Vector<CInt, 123>>
19+ // CHECK: typealias WrappedMagicIntFixedSizeArr2 = MagicWrapper<Vector<CInt, 124>>
1620
1721// CHECK: typealias DoubleWrappedInt = DoubleWrapper<MagicWrapper<CInt>>
1822// CHECK: typealias DoubleWrappedIntConst = DoubleWrapper<MagicWrapper<CInt_const>>
1923// CHECK: typealias DoubleWrappedLongConst = DoubleWrapper<MagicWrapper<CLong_const>>
2024// CHECK: typealias DoubleWrappedIntPtr = DoubleWrapper<MagicWrapper<UnsafeMutablePointer<CInt>>>
2125// CHECK: typealias DoubleWrappedIntConstPtr = DoubleWrapper<MagicWrapper<UnsafePointer<CInt>>>
26+ // CHECK: typealias DoubleWrappedMagicIntArr = DoubleWrapper<MagicWrapper<[CInt]>>
27+ // CHECK: typealias DoubleWrappedMagicLongArr = DoubleWrapper<MagicWrapper<[CLong]>>
28+ // CHECK: typealias DoubleWrappedMagicIntFixedSizeArr1 = DoubleWrapper<MagicWrapper<Vector<CInt, 42>>>
29+ // CHECK: typealias DoubleWrappedMagicIntFixedSizeArr2 = DoubleWrapper<MagicWrapper<Vector<CInt, 43>>>
You can’t perform that action at this time.
0 commit comments