mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
25 lines
937 B
Swift
25 lines
937 B
Swift
// RUN: %target-swift-frontend -parse-as-library -module-name=test -primary-file %s -O -emit-sil | %FileCheck %s
|
|
|
|
|
|
// Check if the compiler can convert a partial_apply of a dead argument (an
|
|
// unused metatype) to a thin_to_thick_function
|
|
|
|
extension Int32 {
|
|
|
|
// This function has an unused metatype argument.
|
|
|
|
// CHECK-LABEL: sil [thunk] [always_inline] @_T0s5Int32V4testE8lessthan3lhs3rhsSbAB_ABtFZ : $@convention(method) (Int32, Int32, @thin Int32.Type) -> Bool
|
|
public static func lessthan (lhs: Int32, rhs: Int32) -> Bool {
|
|
return lhs < rhs
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_T04test6callitSbs5Int32V_ADtcyF : $@convention(thin) () -> @owned @callee_guaranteed (Int32, Int32) -> Bool
|
|
// CHECK: [[F:%[0-9]+]] = function_ref @_T0s5Int32V4testE8lessthan3lhs3rhsSbAB_ABtFZTf4nnd_n
|
|
// CHECK: [[R:%[0-9]+]] = thin_to_thick_function [[F]]
|
|
// CHECK: return [[R]]
|
|
func callit() -> (Int32, Int32) -> Bool {
|
|
return (Int32.lessthan)
|
|
}
|
|
|