Skip to content

Commit 146d050

Browse files
authored
Merge pull request #12514 from dcci/verification
[SILVerifier] Add a test for SIL entry block with predecessors.
2 parents d3ebc28 + 463f89f commit 146d050

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/SILOptimizer/cyclic_entry.sil

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: not --crash %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s 2> %t/err.txt
3+
// RUN: %FileCheck %s < %t/err.txt
4+
5+
// REQUIRES: asserts
6+
7+
// The test in this file is meant to fail the verifier, as the entry block of a SIL
8+
// function can't have a predecessor.
9+
10+
import Builtin
11+
import Swift
12+
13+
// CHECK: SIL verification failed: entry block cannot have predecessors
14+
15+
sil @patatino : $@convention(thin) () -> Never {
16+
bb0:
17+
br bb0
18+
}

0 commit comments

Comments
 (0)