mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
I did this using a sed pattern and verified by hand that I was only touching target-swift-emit-silgen lines.
22 lines
532 B
Swift
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)
|
|
|