Skip to content

Commit 0965598

Browse files
committed
tests: add some performance diagnostics tests for integer operations
1 parent 7a2f410 commit 0965598

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/SILOptimizer/performance-annotations.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ func callFuncWithMetatypeArg() {
139139
metatypeArg(Int.self, false) // expected-note {{called from here}}
140140
}
141141

142+
@_noAllocation
143+
func intConversion() {
144+
let x = 42
145+
_ = UInt(x)
146+
}
147+
148+
@_noAllocation
149+
func integerRange() {
150+
for _ in 0 ..< 10 {
151+
}
152+
}
153+
142154
struct GenStruct<A> {
143155
var a: A
144156
}

0 commit comments

Comments
 (0)