1
1
// REQUIRES: swift_feature_SafeInteropWrappers
2
2
3
- // RUN: %target-swift-ide-test -print-module -module-to-print=CountedByClang -plugin-path %swift-plugin-dir -I %S/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers -Xcc -Wno-nullability-completeness | %FileCheck %s
3
+ // RUN: %target-swift-ide-test -print-module -module-to-print=CountedByClang -plugin-path %swift-plugin-dir -I %S/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers -Xcc -Werror -Xcc - Wno-nullability-completeness -Xcc -Wno-div-by-zero -Xcc -Wno-pointer-to-int-cast | %FileCheck %s
4
4
5
5
// swift-ide-test doesn't currently typecheck the macro expansions, so run the compiler as well
6
6
// RUN: %empty-directory(%t)
7
- // RUN: %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/CountedBy.swiftmodule -I %S/Inputs -enable-experimental-feature SafeInteropWrappers -strict-memory-safety -warnings-as-errors -Xcc -Werror -Xcc -Wno-nullability-completeness %s
7
+ // RUN: %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/CountedBy.swiftmodule -I %S/Inputs -enable-experimental-feature SafeInteropWrappers -strict-memory-safety -warnings-as-errors -Xcc -Werror -Xcc -Wno-nullability-completeness -Xcc -Wno-div-by-zero -Xcc -Wno-pointer-to-int-cast %s
8
8
9
9
// Check that ClangImporter correctly infers and expands @_SwiftifyImport macros for functions with __counted_by parameters.
10
10
11
11
import CountedByClang
12
12
13
13
14
14
// CHECK: /// This is an auto-generated wrapper for safer interop
15
+ // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func binaryLiteral(_ p: UnsafeMutableBufferPointer<Int32>)
16
+
17
+ // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
15
18
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func bitshift(_ m: Int32, _ n: Int32, _ o: Int32, _ p: UnsafeMutableBufferPointer<Int32>)
16
19
17
20
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
@@ -26,6 +29,9 @@ import CountedByClang
26
29
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
27
30
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func constInt(_ p: UnsafeMutableBufferPointer<Int32>)
28
31
32
+ // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
33
+ // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func hexLiteral(_ p: UnsafeMutableBufferPointer<Int32>)
34
+
29
35
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
30
36
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
31
37
@@ -35,6 +41,9 @@ import CountedByClang
35
41
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
36
42
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: UnsafeMutableBufferPointer<Int{{.*}}>?)
37
43
44
+ // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
45
+ // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func octalLiteral(_ p: UnsafeMutableBufferPointer<Int32>)
46
+
38
47
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
39
48
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func offByOne(_ len: Int32, _ p: UnsafeMutableBufferPointer<Int32>)
40
49
@@ -57,19 +66,28 @@ import CountedByClang
57
66
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simpleFlipped(_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
58
67
59
68
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
60
- // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func sizeofParam (_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
69
+ // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr (_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
61
70
62
- // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
63
- // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func sizeofType(_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
71
+ @inlinable
72
+ public func callBitshift( _ m: CInt , n: CInt , o: CInt , _ p: UnsafeMutableBufferPointer < CInt > ) {
73
+ unsafe bitshift ( m, n, o, p)
74
+ }
64
75
65
- // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
66
- // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: UnsafeMutableBufferPointer<Int{{.*}}>)
76
+ @inlinable
77
+ public func callBitwise( _ m: CInt , n: CInt , o: CInt , _ p: UnsafeMutableBufferPointer < CInt > ) {
78
+ unsafe bitwise( m, n, o, p)
79
+ }
67
80
68
81
@inlinable
69
82
public func callComplexExpr( _ p: UnsafeMutableBufferPointer < CInt > ) {
70
83
unsafe complexExpr( CInt ( p. count) , 1 , p)
71
84
}
72
85
86
+ @inlinable
87
+ public func callConstFloatCastedToInt( _ p: UnsafeMutableBufferPointer < CInt > ) {
88
+ unsafe constFloatCastedToInt( p)
89
+ }
90
+
73
91
@inlinable
74
92
public func callConstInt( _ p: UnsafeMutableBufferPointer < CInt > ) {
75
93
unsafe constInt( p)
@@ -90,11 +108,21 @@ public func callNullable(_ p: UnsafeMutableBufferPointer<CInt>?) {
90
108
unsafe nullable( p)
91
109
}
92
110
111
+ @inlinable
112
+ public func callOctalLiteral( _ p: UnsafeMutableBufferPointer < CInt > ) {
113
+ unsafe octalLiteral( p)
114
+ }
115
+
93
116
@inlinable
94
117
public func callOffByOne( _ p: UnsafeMutableBufferPointer < CInt > ) {
95
118
unsafe offByOne( 0 , p)
96
119
}
97
120
121
+ @inlinable
122
+ public func callOffBySome( _ p: UnsafeMutableBufferPointer < CInt > ) {
123
+ unsafe offBySome( 0 , 1 , p)
124
+ }
125
+
98
126
@inlinable
99
127
public func callReturnPointer( ) {
100
128
let _: UnsafeMutableBufferPointer < CInt > ? = returnPointer ( 4 ) // call wrapper
0 commit comments