mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
603 B
Swift
19 lines
603 B
Swift
// RUN: %target-swift-frontend -O %s -disable-llvm-optzns -emit-sil -g -o - | FileCheck %s
|
|
|
|
// CHECK: sil shared [noinline] @_TTSg5SiSis17IntegerArithmetics__
|
|
// CHECK-SAME: _TF14specialization3sumuRxs17IntegerArithmeticrFTxx_x
|
|
// CHECK-SAME: $@convention(thin) (Int, Int) -> Int {
|
|
// CHECK: bb0(%0 : $Int, %1 : $Int):
|
|
// CHECK: debug_value %0 : $Int, let, name "i", argno 1
|
|
// CHECK: debug_value %1 : $Int, let, name "j", argno 2
|
|
|
|
@inline(never)
|
|
public func sum<T : IntegerArithmetic>(i : T, _ j : T) -> T {
|
|
let result = i + j
|
|
return result
|
|
}
|
|
|
|
public func inc(i: inout Int) {
|
|
i = sum(i, 1)
|
|
}
|