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
137
137
Visit (type->getElementType ().getTypePtr ()) + " >" )
138
138
.str ();
139
139
}
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
+ }
140
151
};
141
152
142
153
std::string swift::importer::printClassTemplateSpecializationName (
Original file line number Diff line number Diff line change @@ -19,11 +19,19 @@ typedef MagicWrapper<const long> WrappedMagicLongConst;
19
19
typedef MagicWrapper<int *> WrappedMagicIntPtr;
20
20
typedef MagicWrapper<const int *> WrappedMagicIntConstPtr;
21
21
typedef 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;
22
26
23
27
typedef DoubleWrapper<MagicWrapper<int >> DoubleWrappedInt;
24
28
typedef DoubleWrapper<MagicWrapper<const int >> DoubleWrappedIntConst;
25
29
typedef DoubleWrapper<MagicWrapper<const long >> DoubleWrappedLongConst;
26
30
typedef DoubleWrapper<MagicWrapper<int *>> DoubleWrappedIntPtr;
27
31
typedef 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;
28
36
29
37
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_WITH_PRIMITIVE_ARGUMENT_H
Original file line number Diff line number Diff line change 13
13
// CHECK: typealias WrappedMagicIntPtr = MagicWrapper<UnsafeMutablePointer<CInt>>
14
14
// CHECK: typealias WrappedMagicIntConstPtr = MagicWrapper<UnsafePointer<CInt>>
15
15
// 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>>
16
20
17
21
// CHECK: typealias DoubleWrappedInt = DoubleWrapper<MagicWrapper<CInt>>
18
22
// CHECK: typealias DoubleWrappedIntConst = DoubleWrapper<MagicWrapper<CInt_const>>
19
23
// CHECK: typealias DoubleWrappedLongConst = DoubleWrapper<MagicWrapper<CLong_const>>
20
24
// CHECK: typealias DoubleWrappedIntPtr = DoubleWrapper<MagicWrapper<UnsafeMutablePointer<CInt>>>
21
25
// 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