Files
swift-mirror/test/SILGen/static-stored-properties-in-concrete-contexts.swift
Michael Gottesman 9e13779702 [ownership] Remove most -enable-sil-ownership from SILGen now that %target-swift-emit-silgen does it automatically.
I did this using a sed pattern and verified by hand that I was only touching
target-swift-emit-silgen lines.
2018-12-13 11:54:54 -08:00

22 lines
532 B
Swift

// RUN: %target-swift-emit-silgen %s | %FileCheck %s
struct Foo<T> {
static var foo: T { return (0 as Int) as! T }
}
extension Foo where T == Int {
// CHECK: sil_global private [[X_TOKEN:@.*]] : $Builtin.Word
// CHECK: sil_global hidden [let] @$s4main3FooVAASiRszlE1xSivpZ : $Int
static let x = foo
// CHECK: sil_global private [[Y_TOKEN:@.*]] : $Builtin.Word
// CHECK: sil_global hidden @$s4main3FooVAASiRszlE1ySivpZ : $Int
static var y = foo
}
print(Foo<Int>.x)
Foo<Int>.y = 2
Foo<Int>.y += 3
print(Foo<Int>.y)