Files
swift-mirror/test/IRGen/async/Inputs/class_open-1instance-void_to_void.swift
Nate Chandler 2e880af6a0 [TBDGen] Use effective linkage for class member async function pointers.
Previously, the "bare" linkage of a link entity was used to determine
whether to put an async function pointer into the tbd.  That did not
match the mechanism by which the linkage was determined in IRGen.
There, the linkage is the "_effective_" linkage (i.e. the value returned
from SILFunction::getEffectiveSymbolLinkage).

Here, whether to put the async function pointer corresponding to a class
method is determined on the basis of that effective linkage.

rdar://problem/73203508
2021-01-19 08:45:04 -08:00

26 lines
938 B
Swift

import _Concurrency
func printGeneric<T>(_ t: T) {
print(t)
}
// CHECK-LL: @"$s4main6call_fyyAA1CCYFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
// CHECK-LL: @"$s4main1CC1fyyYFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s4main6call_fyyAA1CCYF"(%swift.task* {{%[0-9]+}}, %swift.executor* {{%[0-9]+}}, %swift.context* {{%[0-9]+}}) {{#[0-9]*}} {
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s4main1CC1fyyYF"(%swift.task* {{%[0-9]+}}, %swift.executor* {{%[0-9]+}}, %swift.context* {{%[0-9]+}}) {{#[0-9]*}} {
public func call_f(_ c: C) async {
print("entering call_f")
await c.f()
print("exiting call_f")
}
open class C {
public init() {}
func f() async {
printGeneric("entering f")
printGeneric(Self.self)
printGeneric(self)
printGeneric("exiting f")
}
}