[embedded] Fix IR verification crash when using arrays of zero-sized structs

This commit is contained in:
Kuba Mracek
2023-10-05 21:37:48 -07:00
parent e01f23496a
commit f808882743
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
public struct MyStruct {
}
public func main() {
var arr: [MyStruct] = []
var arr2: [MyStruct] = [.init()]
var arr3 = arr2
arr3.append(MyStruct())
}
public func copy(_ a: inout [MyStruct]) {
var a = a
}
// CHECK: define {{.*}}@"$s4mainAAyyF"
// CHECK: define {{.*}}@"$s4main4copyyySayAA8MyStructVGzF"