@@ -18,14 +18,8 @@ func testSimpleInterpolation() {
18
18
// CHECK-DAG is used here as it is easier to perform the checks backwards
19
19
// from uses to the definitions.
20
20
21
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
22
- // We need to wade through some borrows and copy values here.
23
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
24
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
25
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
26
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
27
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
28
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Minimum integer value: %ld"
21
+ // Match the format string first.
22
+ // CHECK: string_literal utf8 "Minimum integer value: %ld"
29
23
30
24
// Check if the size of the argument buffer is a constant.
31
25
@@ -71,13 +65,8 @@ func testInterpolationWithFormatOptions() {
71
65
72
66
// Check if there is a call to _os_log_impl with a literal format string.
73
67
74
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
75
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
76
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
77
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
78
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
79
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
80
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Maximum unsigned integer value: %lx"
68
+ // Match the format string first.
69
+ // CHECK: string_literal utf8 "Maximum unsigned integer value: %lx"
81
70
82
71
// Check if the size of the argument buffer is a constant.
83
72
@@ -124,13 +113,8 @@ func testInterpolationWithFormatOptionsAndPrivacy() {
124
113
125
114
// Check if there is a call to _os_log_impl with a literal format string.
126
115
127
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
128
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
129
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
130
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
131
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
132
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
133
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Private Identifier: %{private}lx"
116
+ // Match the format string first.
117
+ // CHECK: string_literal utf8 "Private Identifier: %{private}lx"
134
118
135
119
// Check if the size of the argument buffer is a constant.
136
120
@@ -183,13 +167,8 @@ func testInterpolationWithMultipleArguments() {
183
167
184
168
// Check if there is a call to _os_log_impl with a literal format string.
185
169
186
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
187
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
188
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
189
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
190
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
191
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
192
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Access prevented: process %{public}ld initiated by user: %{private}ld attempted resetting permissions to %lo"
170
+ // Match the format string first.
171
+ // CHECK: string_literal utf8 "Access prevented: process %{public}ld initiated by user: %{private}ld attempted resetting permissions to %lo"
193
172
194
173
// Check if the size of the argument buffer is a constant.
195
174
@@ -240,13 +219,8 @@ func testLogMessageWithoutData() {
240
219
241
220
// Check if there is a call to _os_log_impl with a literal format string.
242
221
243
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
244
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
245
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
246
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
247
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
248
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
249
- // CHECK-DAG: [[LIT]] = string_literal utf8 "A message with no data"
222
+ // Match the format string first.
223
+ // CHECK: string_literal utf8 "A message with no data"
250
224
251
225
// Check if the size of the argument buffer is a constant.
252
226
@@ -284,37 +258,22 @@ func testLogMessageWithoutData() {
284
258
// CHECK-LABEL: @${{.*}}testEscapingOfPercentsyy
285
259
func testEscapingOfPercents( ) {
286
260
_osLogTestHelper ( " Process failed after 99% completion " )
287
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
288
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
289
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
290
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
291
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
292
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
293
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Process failed after 99%% completion"
261
+ // Match the format string first.
262
+ // CHECK: string_literal utf8 "Process failed after 99%% completion"
294
263
}
295
264
296
265
// CHECK-LABEL: @${{.*}}testDoublePercentsyy
297
266
func testDoublePercents( ) {
298
267
_osLogTestHelper ( " Double percents: %% " )
299
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
300
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
301
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
302
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
303
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
304
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
305
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Double percents: %%%%"
268
+ // Match the format string first.
269
+ // CHECK: string_literal utf8 "Double percents: %%%%"
306
270
}
307
271
308
272
// CHECK-LABEL: @${{.*}}testSmallFormatStringsyy
309
273
func testSmallFormatStrings( ) {
310
274
_osLogTestHelper ( " a " )
311
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
312
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
313
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
314
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
315
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
316
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
317
- // CHECK-DAG: [[LIT]] = string_literal utf8 "a"
275
+ // Match the format string first.
276
+ // CHECK: string_literal utf8 "a"
318
277
}
319
278
320
279
/// A stress test that checks whether the optimizer handle messages with more
@@ -332,13 +291,8 @@ func testMessageWithTooManyArguments() {
332
291
333
292
// Check if there is a call to _os_log_impl with a literal format string.
334
293
335
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
336
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
337
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
338
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
339
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
340
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
341
- // CHECK-DAG: [[LIT]] = string_literal utf8 "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld "
294
+ // Match the format string first.
295
+ // CHECK: string_literal utf8 "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld "
342
296
343
297
// Check if the size of the argument buffer is a constant.
344
298
@@ -382,13 +336,8 @@ func testInt32Interpolation() {
382
336
383
337
// Check if there is a call to _os_log_impl with a literal format string.
384
338
385
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
386
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
387
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
388
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
389
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
390
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
391
- // CHECK-DAG: [[LIT]] = string_literal utf8 "32-bit integer value: %d"
339
+ // Match the format string first.
340
+ // CHECK: string_literal utf8 "32-bit integer value: %d"
392
341
393
342
// Check if the size of the argument buffer is a constant.
394
343
@@ -426,13 +375,8 @@ func testDynamicStringArguments() {
426
375
// CHECK-DAG is used here as it is easier to perform the checks backwards
427
376
// from uses to the definitions.
428
377
429
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
430
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
431
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
432
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
433
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
434
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
435
- // CHECK-DAG: [[LIT]] = string_literal utf8 "concat: %{public}s interpolated: %{private}s"
378
+ // Match the format string first.
379
+ // CHECK: string_literal utf8 "concat: %{public}s interpolated: %{private}s"
436
380
437
381
// Check if the size of the argument buffer is a constant.
438
382
@@ -484,13 +428,8 @@ func testNSObjectInterpolation() {
484
428
// CHECK-DAG is used here as it is easier to perform the checks backwards
485
429
// from uses to the definitions.
486
430
487
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
488
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
489
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
490
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
491
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
492
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
493
- // CHECK-DAG: [[LIT]] = string_literal utf8 "NSArray: %{public}@ NSDictionary: %{private}@"
431
+ // Match the format string first.
432
+ // CHECK: string_literal utf8 "NSArray: %{public}@ NSDictionary: %{private}@"
494
433
495
434
// Check if the size of the argument buffer is a constant.
496
435
@@ -537,13 +476,8 @@ func testDoubleInterpolation() {
537
476
// CHECK-DAG is used here as it is easier to perform the checks backwards
538
477
// from uses to the definitions.
539
478
540
- // CHECK-DAG: builtin "globalStringTablePointer"([[STRING:%[0-9]+]] : $String)
541
- // CHECK-DAG: [[STRING]] = begin_borrow [[STRING2:%[0-9]+]]
542
- // CHECK-DAG: [[STRING2]] = copy_value [[STRING3:%[0-9]+]]
543
- // CHECK-DAG: [[STRING3]] = begin_borrow [[STRING4:%[0-9]+]]
544
- // CHECK-DAG: [[STRING4]] = apply [[STRING_INIT:%[0-9]+]]([[LIT:%[0-9]+]],
545
- // CHECK-DAG: [[STRING_INIT]] = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC
546
- // CHECK-DAG: [[LIT]] = string_literal utf8 "Tau = %f"
479
+ // Match the format string first.
480
+ // CHECK: string_literal utf8 "Tau = %f"
547
481
548
482
// Check if the size of the argument buffer is a constant.
549
483
0 commit comments