mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[embedded] Fix IR verification crash when using arrays of zero-sized structs
This commit is contained in:
21
test/embedded/array-zero-size-struct.swift
Normal file
21
test/embedded/array-zero-size-struct.swift
Normal 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"
|
||||
Reference in New Issue
Block a user