Skip to content

Commit 55b9e43

Browse files
committed
SIL: reduced test case for SIL verifier failure
This is a reduced test case from the Foundation test suite which triggers a SIL verifier error on Windows at least: ``` SIL verification failed: instruction isn't dominated by its operand: properlyDominates(valueI, I) Verifying instruction: %54 = struct_element_addr %53 : $*S, #S.args // users: %130, %116, %55 -> destroy_addr %54 : $*Array<Substring> // id: %130 ```
1 parent cf32559 commit 55b9e43

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/SIL/destroy-dominator.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %swiftc -sil-verify-all -O -c %s -o /dev/null
2+
// REQUIRES: asserts
3+
4+
public struct S {
5+
let args: [Substring]
6+
let arg: Substring
7+
8+
enum Error: Swift.Error {
9+
case Case
10+
}
11+
12+
public init(arg: String) throws {
13+
args = arg.split(separator: "\n")
14+
guard args.count > 0 else { throw Error.Case }
15+
16+
let parts = args[0].split(separator: " ")
17+
guard parts.count > 2 else { throw Error.Case }
18+
19+
self.arg = parts[1]
20+
}
21+
}
22+

0 commit comments

Comments
 (0)