Files
swift-mirror/test/SILGen/inlineable_attribute_objc.swift
T
Michael Gottesman 6f4e87ad3f [+0-all-args] Be explicit about the module-name for tests that have plus_zero_* counterparts.
Otherwise, the plus_zero_* tests will have plus_zero_* as a module name, causing
massive FileCheck problems.

The reason why I am doing it with the main tests is so that I can use it when
syncing branches/etc.

radar://34222540
2018-03-11 21:55:24 -07:00

37 lines
1.3 KiB
Swift

// REQUIRES: plus_one_runtime
// RUN: %empty-directory(%t)
// RUN: %build-silgen-test-overlays
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -module-name inlineable_attribute_objc -Xllvm -sil-full-demangle -primary-file %s -emit-silgen | %FileCheck %s
// REQUIRES: objc_interop
import Foundation
public class Horse : NSObject {
public dynamic func gallop() {}
}
// Make sure we can reference dynamic thunks and curry thunks
// from inlineable scopes
// CHECK-LABEL: sil [serialized] @$S25inlineable_attribute_objc15talkAboutAHorse1hyAA5HorseC_tF : $@convention(thin) (@owned Horse) -> () {
// CHECK: function_ref @$S25inlineable_attribute_objc5HorseC6gallopyyFTc : $@convention(thin) (@owned Horse) -> @owned @callee_guaranteed () -> ()
// CHECK: return
// CHECK: }
// CHECK-LABEL: sil shared [serializable] [thunk] @$S25inlineable_attribute_objc5HorseC6gallopyyFTc : $@convention(thin) (@owned Horse) -> @owned @callee_guaranteed () -> ()
// CHECK: %1 = function_ref @$S25inlineable_attribute_objc5HorseC6gallopyyFTD
// CHECK: return
// CHECK: }
// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @$S25inlineable_attribute_objc5HorseC6gallopyyFTD : $@convention(method) (@guaranteed Horse) -> ()
// CHECK: objc_method
// CHECK: return
// CHECK: }
@_inlineable public func talkAboutAHorse(h: Horse) {
_ = h.gallop
}