Files
swift-mirror/test/embedded/default-arguments.swift
Erik Eckstein 874360e719 GenericCloner: make sure that we can always specialize in mandatory mode
This may involve changing the linkage of the specialized function.
If called from a serialized function we cannot make the specialized function shared and non-serialized.
The only other option is to keep the original function's linkage.

rdar://121675461
2024-02-02 07:28:42 +01:00

20 lines
380 B
Swift

// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded -o /dev/null
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// Check that this doesn't crash the compiler in embedded mode.
public func foo<T>(_ t: T) -> T {
t
}
public func testit(_ x: Int = foo(27)) -> Int {
x
}
public func callit() -> Int {
testit()
}