Skip to content

Commit d27ca6a

Browse files
committed
add a test to verify that precondition doesn't allocate in Onone builds
1 parent e718bfe commit d27ca6a

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)