mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This increases the chances that multiple specializations from the same function can be merged with LLVM's function merge pass.
42 lines
566 B
Swift
42 lines
566 B
Swift
|
|
@inline(never)
|
|
func incrementit(_ x: Int) -> Int {
|
|
return x + 1
|
|
}
|
|
|
|
class Derived : Base {
|
|
override func memberfunc(_ x: Int) -> Int {
|
|
return x + 2
|
|
}
|
|
}
|
|
|
|
public struct MyStruct : MyProto {
|
|
|
|
var x: Int
|
|
|
|
func protofunc() -> Int {
|
|
return x
|
|
}
|
|
}
|
|
|
|
@_transparent public func transparentfunc(_ x: Int) -> Int {
|
|
return x + 3
|
|
}
|
|
|
|
public func mutateMyStructArray(_ arr: inout [MyStruct], _ x: MyStruct) {
|
|
arr.append(x)
|
|
}
|
|
|
|
public var g1 = 234
|
|
|
|
let i = testit(27)
|
|
print(i)
|
|
|
|
let i2 = callmember(Derived())
|
|
print(i2)
|
|
|
|
callproto(MyStruct(x: 42))
|
|
|
|
print(callPrivInc(g1))
|
|
|