Files
swift-mirror/test/SILOptimizer/stored_property_initial_value.swift
Slava Pestov 85b94a4300 SILGen: Refactor emitMemberInitializers() to use Initialization
Instead of constructing an LValue and storing the result of the
stored property initializer to the lvalue, let's emit the call
of the stored property initializer directly into an initialization
pointing at the stored properties named by the pattern.
2020-10-11 12:48:30 -04:00

30 lines
615 B
Swift

// RUN: %target-swift-frontend -emit-sil %s
// This is an integration test to ensure that SILGen, DI and the ownership
// verifier support the SIL we generate for stored properties with initial
// values.
enum E {
case foo(Any)
}
struct S<T, U : BinaryInteger> {
var x1: T? = nil
var x2 = 0 as! T
var x3 = E.foo(0)
var x4: (Int, Int, Int, Int) = (0, 0, 0, 0)
var x5: (U, U, U, U) = (0, 0, 0, 0)
init() {}
}
class C<T, U : BinaryInteger> {
var x1: T? = nil
var x2 = 0 as! T
var x3 = E.foo(0)
var x4: (Int, Int, Int, Int) = (0, 0, 0, 0)
var x5: (U, U, U, U) = (0, 0, 0, 0)
init() {}
}