@@ -59,155 +59,3 @@ public func run_StringFromLongWholeSubstringGeneric(_ N: Int) {
59
59
}
60
60
}
61
61
62
- private func equivalentWithDistinctBuffers( ) -> ( String , Substring ) {
63
- var s0 = longWide
64
- withUnsafeMutablePointer ( to: & s0) { blackHole ( $0) }
65
- s0 += " ! "
66
-
67
- // These two should be equal but with distinct buffers, both refcounted.
68
- let a = Substring ( s0) . dropFirst ( )
69
- let b = String ( a)
70
- return ( b, a)
71
- }
72
-
73
- @inline ( never)
74
- public func run_EqualStringSubstring( _ N: Int ) {
75
- let ( a, b) = equivalentWithDistinctBuffers ( )
76
- for _ in 1 ... N*500 {
77
- blackHole ( a == b)
78
- }
79
- }
80
-
81
- @inline ( never)
82
- public func run_EqualSubstringString( _ N: Int ) {
83
- let ( a, b) = equivalentWithDistinctBuffers ( )
84
- for _ in 1 ... N*500 {
85
- blackHole ( b == a)
86
- }
87
- }
88
-
89
- @inline ( never)
90
- public func run_EqualSubstringSubstring( _ N: Int ) {
91
- let ( _, a) = equivalentWithDistinctBuffers ( )
92
- let ( _, b) = equivalentWithDistinctBuffers ( )
93
- for _ in 1 ... N*500 {
94
- blackHole ( a == b)
95
- }
96
- }
97
-
98
- @inline ( never)
99
- public func run_EqualSubstringSubstringGenericEquatable( _ N: Int ) {
100
- let ( _, a) = equivalentWithDistinctBuffers ( )
101
- let ( _, b) = equivalentWithDistinctBuffers ( )
102
- func check< T> ( _ x: T , _ y: T ) where T : Equatable {
103
- blackHole ( x == y)
104
- }
105
- for _ in 1 ... N*500 {
106
- check ( a, b)
107
- }
108
- }
109
-
110
- /*
111
- func checkEqual<T, U>(_ x: T, _ y: U)
112
- where T : StringProtocol, U : StringProtocol {
113
- blackHole(x == y)
114
- }
115
-
116
- @inline(never)
117
- public func run_EqualStringSubstringGenericStringProtocol(_ N: Int) {
118
- let (a, b) = equivalentWithDistinctBuffers()
119
- for _ in 1...N*500 {
120
- checkEqual(a, b)
121
- }
122
- }
123
-
124
- @inline(never)
125
- public func run_EqualSubstringStringGenericStringProtocol(_ N: Int) {
126
- let (a, b) = equivalentWithDistinctBuffers()
127
- for _ in 1...N*500 {
128
- checkEqual(b, a)
129
- }
130
- }
131
-
132
- @inline(never)
133
- public func run_EqualSubstringSubstringGenericStringProtocol(_ N: Int) {
134
- let (_, a) = equivalentWithDistinctBuffers()
135
- let (_, b) = equivalentWithDistinctBuffers()
136
- for _ in 1...N*500 {
137
- checkEqual(a, b)
138
- }
139
- }
140
- */
141
-
142
- //===----------------------------------------------------------------------===//
143
-
144
- /*
145
- @inline(never)
146
- public func run_LessStringSubstring(_ N: Int) {
147
- let (a, b) = equivalentWithDistinctBuffers()
148
- for _ in 1...N*500 {
149
- blackHole(a < b)
150
- }
151
- }
152
-
153
- @inline(never)
154
- public func run_LessSubstringString(_ N: Int) {
155
- let (a, b) = equivalentWithDistinctBuffers()
156
- for _ in 1...N*500 {
157
- blackHole(b < a)
158
- }
159
- }
160
- */
161
-
162
- @inline ( never)
163
- public func run_LessSubstringSubstring( _ N: Int ) {
164
- let ( _, a) = equivalentWithDistinctBuffers ( )
165
- let ( _, b) = equivalentWithDistinctBuffers ( )
166
- for _ in 1 ... N*500 {
167
- blackHole ( a < b)
168
- }
169
- }
170
-
171
- @inline ( never)
172
- public func run_LessSubstringSubstringGenericComparable( _ N: Int ) {
173
- let ( _, a) = equivalentWithDistinctBuffers ( )
174
- let ( _, b) = equivalentWithDistinctBuffers ( )
175
- func check< T> ( _ x: T , _ y: T ) where T : Comparable {
176
- blackHole ( x < y)
177
- }
178
- for _ in 1 ... N*500 {
179
- check ( a, b)
180
- }
181
- }
182
-
183
- /*
184
- func checkLess<T, U>(_ x: T, _ y: U)
185
- where T : StringProtocol, U : StringProtocol {
186
- blackHole(x < y)
187
- }
188
-
189
- @inline(never)
190
- public func run_LessStringSubstringGenericStringProtocol(_ N: Int) {
191
- let (a, b) = equivalentWithDistinctBuffers()
192
- for _ in 1...N*500 {
193
- checkLess(a, b)
194
- }
195
- }
196
-
197
- @inline(never)
198
- public func run_LessSubstringStringGenericStringProtocol(_ N: Int) {
199
- let (a, b) = equivalentWithDistinctBuffers()
200
- for _ in 1...N*500 {
201
- checkLess(b, a)
202
- }
203
- }
204
-
205
- @inline(never)
206
- public func run_LessSubstringSubstringGenericStringProtocol(_ N: Int) {
207
- let (_, a) = equivalentWithDistinctBuffers()
208
- let (_, b) = equivalentWithDistinctBuffers()
209
- for _ in 1...N*500 {
210
- checkLess(a, b)
211
- }
212
- }
213
- */
0 commit comments