Skip to content

Commit 80b225d

Browse files
committed
Fix test/TypeDecoder/foreign_types.swift for 32-bit
NSSize is not always aliased to CGSize; on 32-bit platforms it is its own type. Instead, let's just define our own type.
1 parent 1761b4b commit 80b225d

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

test/ClangImporter/Inputs/custom-modules/CoreCooling.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ void CCRefrigeratorGetItemUnaudited(CCRefrigeratorRef fridge, unsigned index, CC
5757

5858
typedef void *CFNonConstVoidRef __attribute__((objc_bridge(id)));
5959
CFNonConstVoidRef CFNonConstBottom();
60+
61+
typedef struct IceCube {
62+
float width;
63+
float height;
64+
float depth;
65+
} IceCube;
66+
67+
typedef IceCube IceCube;
68+
typedef IceCube BlockOfIce;

test/TypeDecoder/foreign_types.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ do {
1919
let x5 = RenamedError.Code.good
2020
let x6 = Wrapper.MemberEnum.A
2121
let x7 = WrapperByAttribute(0)
22-
let x8 = NSSize(width: 0, height: 0)
22+
let x8 = IceCube(width: 0, height: 0, depth: 0)
23+
let x9 = BlockOfIce(width: 0, height: 0, depth: 0)
2324
}
2425

2526
do {
@@ -30,7 +31,8 @@ do {
3031
let x5 = RenamedError.Code.self
3132
let x6 = Wrapper.MemberEnum.self
3233
let x7 = WrapperByAttribute.self
33-
let x8 = NSSize.self
34+
let x8 = IceCube.self
35+
let x9 = BlockOfIce.self
3436
}
3537
*/
3638

@@ -41,8 +43,8 @@ do {
4143
// DEMANGLE: $sSo14MyRenamedErrorLeVD
4244
// DEMANGLE: $sSo12MyMemberEnumVD
4345
// DEMANGLE: $sSo18WrapperByAttributeaD
44-
// DEMANGLE: $sSo6NSSizeaD
45-
// DEMANGLE: $sSo6CGSizeVD
46+
// DEMANGLE: $sSo7IceCubeVD
47+
// DEMANGLE: $sSo10BlockOfIceaD
4648

4749
// CHECK: CCRefrigerator
4850
// CHECK: MyError.Code
@@ -51,8 +53,8 @@ do {
5153
// CHECK: RenamedError
5254
// CHECK: Wrapper.MemberEnum
5355
// CHECK: WrapperByAttribute
54-
// CHECK: NSSize
55-
// CHECK: CGSize
56+
// CHECK: IceCube
57+
// CHECK: BlockOfIce
5658

5759
// DEMANGLE: $sSo17CCRefrigeratorRefamD
5860
// DEMANGLE: $sSo7MyErrorVmD
@@ -61,8 +63,8 @@ do {
6163
// DEMANGLE: $sSC14MyRenamedErrorLeVmD
6264
// DEMANGLE: $sSo12MyMemberEnumVmD
6365
// DEMANGLE: $sSo18WrapperByAttributeamD
64-
// DEMANGLE: $sSo6NSSizeamD
65-
// DEMANGLE: $sSo6CGSizeVmD
66+
// DEMANGLE: $sSo7IceCubeVmD
67+
// DEMANGLE: $sSo10BlockOfIceamD
6668

6769
// CHECK: CCRefrigerator.Type
6870
// CHECK: MyError.Code.Type
@@ -71,5 +73,5 @@ do {
7173
// CHECK: RenamedError.Type
7274
// CHECK: Wrapper.MemberEnum.Type
7375
// CHECK: WrapperByAttribute.Type
74-
// CHECK: NSSize.Type
75-
// CHECK: CGSize.Type
76+
// CHECK: IceCube.Type
77+
// CHECK: BlockOfIce.Type

0 commit comments

Comments
 (0)