Skip to content

Commit 0b9b942

Browse files
committed
add a test to verify that precondition doesn't allocate in Onone builds
1 parent 26a381b commit 0b9b942

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/SILOptimizer/performance-annotations.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,8 @@ func testInfiniteLoop(_ c: Cl) {
412412
while true {}
413413
}
414414

415+
@_noAllocation
416+
func testPrecondition(_ count: Int) {
417+
precondition(count == 2, "abc")
418+
}
419+

0 commit comments

Comments
 (0)