1
- // RUN: %target-swiftxx-frontend %use_no_opaque_pointers -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions | %FileCheck %s
2
- // RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions
1
+ // RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions | %FileCheck %s
3
2
4
3
// https://github.com/apple/swift/issues/55575
5
4
// We can't yet call member functions correctly on Windows.
8
7
import CXXInterop
9
8
10
9
// CHECK-LABEL: define hidden swiftcc void @"$s6cxx_ir13indirectUsageyyF"()
11
- // CHECK: %0 = call %"class.ns::T"* @{{_Z5makeTv|"\?makeT@@YAPE?AVT@ns@@XZ"}}()
12
- // CHECK: call void @{{_Z4useTPN2ns1TE|"\?useT@@YAXPE?AVT@ns@@@Z"}}(%"class.ns::T"* %2)
10
+ // CHECK: %0 = call ptr @{{_Z5makeTv|"\?makeT@@YAPE?AVT@ns@@XZ"}}()
11
+ // CHECK: call void @{{_Z4useTPN2ns1TE|"\?useT@@YAXPE?AVT@ns@@@Z"}}(ptr %2)
13
12
func indirectUsage( ) {
14
13
useT ( makeT ( ) )
15
14
}
16
15
17
- // CHECK-LABEL: define hidden swiftcc %swift.type* @"$s6cxx_ir14reflectionInfo3argypXpSo2nsO1TV_tF"
16
+ // CHECK-LABEL: define hidden swiftcc ptr @"$s6cxx_ir14reflectionInfo3argypXpSo2nsO1TV_tF"
18
17
// CHECK: %0 = call swiftcc %swift.metadata_response @"$sSo2nsO1TVMa"({{i64|i32}} 0)
19
18
func reflectionInfo( arg: namespacedT ) -> Any . Type {
20
19
return type ( of: arg)
@@ -29,26 +28,22 @@ func namespaceManglesIntoNameForUsingShadowDecl(arg: NamespacedType) {
29
28
}
30
29
31
30
// CHECK-LABEL: define hidden swiftcc void @"$s6cxx_ir14accessNSMemberyyF"()
32
- // CHECK: %0 = call %"class.ns::T"* @{{_ZN2ns7doMakeTEv|"\?doMakeT@ns@@YAPEAVT@1@XZ"}}()
33
- // CHECK: call void @{{_Z4useTPN2ns1TE|"\?useT@@YAXPE?AVT@ns@@@Z"}}(%"class.ns::T"* %2)
31
+ // CHECK: %0 = call ptr @{{_ZN2ns7doMakeTEv|"\?doMakeT@ns@@YAPEAVT@1@XZ"}}()
32
+ // CHECK: call void @{{_Z4useTPN2ns1TE|"\?useT@@YAXPE?AVT@ns@@@Z"}}(ptr %2)
34
33
func accessNSMember( ) {
35
34
useT ( ns. doMakeT ( ) )
36
35
}
37
36
38
- // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir12basicMethods1as5Int32VSpySo0D0VG_tF"(i8* %0)
39
- // CHECK: [[THIS_PTR1:%.*]] = bitcast i8* %0 to %TSo7MethodsV*
40
- // CHECK: [[THIS_PTR2:%.*]] = bitcast %TSo7MethodsV* [[THIS_PTR1]] to %class.Methods*
41
- // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZN7Methods12SimpleMethodEi|"\?SimpleMethod@Methods@@QEAAHH@Z"}}(%class.Methods* [[THIS_PTR2]], i32 {{%?[0-9]+}})
37
+ // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir12basicMethods1as5Int32VSpySo0D0VG_tF"(ptr %0)
38
+ // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZN7Methods12SimpleMethodEi|"\?SimpleMethod@Methods@@QEAAHH@Z"}}(ptr %0, i32 {{%?[0-9]+}})
42
39
// CHECK: ret i32 [[RESULT]]
43
40
func basicMethods( a: UnsafeMutablePointer < Methods > ) -> Int32 {
44
41
return a. pointee. SimpleMethod ( 4 )
45
42
}
46
43
47
- // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir17basicMethodsConst1as5Int32VSpySo0D0VG_tF"(i8* %0)
44
+ // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir17basicMethodsConst1as5Int32VSpySo0D0VG_tF"(ptr %0)
48
45
// CHECK: [[THIS_PTR1:%.*]] = alloca %TSo7MethodsV, align {{4|8}}
49
- // CHECK: [[THIS_PTR2:%.*]] = bitcast %TSo7MethodsV* [[THIS_PTR1]] to %class.Methods*
50
- // CHECK: [[THIS_PTR3:%.*]] = bitcast %TSo7MethodsV* [[THIS_PTR1]] to %class.Methods*
51
- // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZNK7Methods17SimpleConstMethodEi|"\?SimpleConstMethod@Methods@@QEBAHH@Z"}}(%class.Methods* [[THIS_PTR3]], i32 {{%?[0-9]+}})
46
+ // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZNK7Methods17SimpleConstMethodEi|"\?SimpleConstMethod@Methods@@QEBAHH@Z"}}(ptr [[THIS_PTR1]], i32 {{%?[0-9]+}})
52
47
// CHECK: ret i32 [[RESULT]]
53
48
func basicMethodsConst( a: UnsafeMutablePointer < Methods > ) -> Int32 {
54
49
return a. pointee. SimpleConstMethod ( 3 )
@@ -61,10 +56,8 @@ func basicMethodsStatic() -> Int32 {
61
56
return Methods . SimpleStaticMethod ( 5 )
62
57
}
63
58
64
- // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir12basicMethods1as5Int32VSpySo8Methods2VG_tF"(i8* %0)
65
- // CHECK: [[THIS_PTR1:%.*]] = bitcast i8* %0 to %TSo8Methods2V*
66
- // CHECK: [[THIS_PTR2:%.*]] = bitcast %TSo8Methods2V* [[THIS_PTR1]] to %class.Methods2*
67
- // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZN8Methods212SimpleMethodEi|"\?SimpleMethod@Methods2@@QEAAHH@Z"}}(%class.Methods2* [[THIS_PTR2]], i32 {{%?[0-9]+}})
59
+ // CHECK-LABEL: define hidden swiftcc i32 @"$s6cxx_ir12basicMethods1as5Int32VSpySo8Methods2VG_tF"(ptr %0)
60
+ // CHECK: [[RESULT:%.*]] = call {{(signext )?}}i32 @{{_ZN8Methods212SimpleMethodEi|"\?SimpleMethod@Methods2@@QEAAHH@Z"}}(ptr %0, i32 {{%?[0-9]+}})
68
61
// CHECK: ret i32 [[RESULT]]
69
62
func basicMethods( a: UnsafeMutablePointer < Methods2 > ) -> Int32 {
70
63
return a. pointee. SimpleMethod ( 4 )
0 commit comments