Skip to content

Commit 4bc049b

Browse files
committed
[TypeChecker] NFC: Add a perf test for rdar://problem/60961087
1 parent 5c58bb8 commit 4bc049b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %scale-test --begin 1 --end 10 --step 1 --select NumLeafScopes %s
2+
// REQUIRES: asserts,no_asan
3+
4+
func test(_ array: [UInt8]) {
5+
var bytes = array.makeIterator()
6+
7+
while let firstByte = bytes.next() {
8+
let secondByte = bytes.next() ?? 0
9+
10+
let encoded = (
11+
(firstByte & 0xF8) >> 3,
12+
%for i in range(0, N):
13+
((firstByte & 0x07) << 2) | ((secondByte & 0xC0) >> 6),
14+
%end
15+
(firstByte & 0xF8) >> 3
16+
)
17+
}
18+
}

0 commit comments

Comments
 (0)