| // RUN: %target-swift-frontend %s -assume-parsing-unqualified-ownership-sil -emit-silgen | %FileCheck %s |
| |
| sil_stage raw |
| |
| import Builtin |
| import Swift |
| |
| enum X { |
| case onetransp |
| case twotransp |
| } |
| |
| sil @_TTWO5test21Xs9EquatableS_FS1_oi2eeUS1___fMQPS1_FT3lhsS2_3rhsS2__Sb : $@convention(witness_method: Equatable) (@in X, @in X, @thick X.Type) -> Bool { |
| bb0(%0 : $*X, %1 : $*X, %2 : $@thick X.Type): |
| %3 = load %0 : $*X |
| %4 = load %1 : $*X |
| |
| %5 = function_ref @_TF5test2oi2eeFTOS_1XS0__Sb : $@convention(thin) (X, X) -> Bool |
| %6 = apply %5(%3, %4) : $@convention(thin) (X, X) -> Bool |
| return %6 : $Bool |
| } |
| |
| |
| sil @_TTWO5test21Xs8HashableS_FS1_g9hashValueSi : $@convention(witness_method: Hashable) (@inout X) -> Int { |
| bb0(%0 : $*X): |
| %1 = load %0 : $*X |
| |
| %2 = function_ref @_TFO5test21Xg9hashValueSi : $@convention(method) (X) -> Int |
| %3 = apply %2(%1) : $@convention(method) (X) -> Int |
| return %3 : $Int |
| } |
| |
| sil @_TF5test2oi2eeFTOS_1XS0__Sb : $@convention(thin) (X, X) -> Bool |
| sil @_TFO5test21Xg9hashValueSi : $@convention(method) (X) -> Int |
| |
| // CHECK-LABEL: sil_witness_table X: Equatable module |
| // CHECK: method #Equatable."=="!1: {{.*}} : @_TTWO5test21Xs9EquatableS_FS1_oi2eeUS1___fMQPS1_FT3lhsS2_3rhsS2__Sb |
| sil_witness_table X: Equatable module test2 { |
| method #Equatable."=="!1: @_TTWO5test21Xs9EquatableS_FS1_oi2eeUS1___fMQPS1_FT3lhsS2_3rhsS2__Sb |
| } |
| |
| // CHECK-LABEL: sil_witness_table X: Hashable module |
| // CHECK: base_protocol Equatable: X: Equatable module |
| // CHECK: method #Hashable.hashValue!getter.1: {{.*}} : @_TTWO5test21Xs8HashableS_FS1_g9hashValueSi |
| sil_witness_table X: Hashable module test2 { |
| base_protocol Equatable: X: Equatable module test2 |
| method #Hashable.hashValue!getter.1: @_TTWO5test21Xs8HashableS_FS1_g9hashValueSi |
| } |