|
1 | 1 | // RUN: %empty-directory(%t) |
2 | 2 | // RUN: %target-swift-frontend -emit-module %s -emit-module-path %t/pack_expansion_type.swiftmodule -DLIB -enable-experimental-feature VariadicGenerics |
3 | | -// RUN: %target-swift-frontend -emit-sil %s -I %t -DAPP -module-name main -enable-experimental-feature VariadicGenerics |
| 3 | +// RUN: %target-swift-frontend -emit-ir %s -I %t -DAPP -module-name main -enable-experimental-feature VariadicGenerics |
4 | 4 |
|
5 | 5 | // Because of -enable-experimental-feature VariadicGenerics |
6 | 6 | // REQUIRES: asserts |
7 | 7 |
|
8 | 8 | #if LIB |
9 | 9 |
|
10 | | -public func callee<each T>(_: repeat each T) {} |
| 10 | +public func calleeWithPack<each T>(_: repeat each T) {} |
11 | 11 |
|
12 | | -@_transparent public func caller<each T>(_ t: repeat each T) { |
13 | | - callee(repeat [each t]) |
| 12 | +public func calleeGeneric<T>(_: T) {} |
| 13 | + |
| 14 | +@_transparent public func transparentCaller<each T>(_ t: repeat each T) { |
| 15 | + calleeWithPack(repeat [each t]) |
| 16 | + calleeGeneric((repeat [each t])) |
14 | 17 | } |
15 | 18 |
|
16 | | -public func calleer() { |
17 | | - caller(1, "hi", false) |
| 19 | +@_alwaysEmitIntoClient public func serializedCaller<each T>(_ t: repeat each T) { |
| 20 | + calleeWithPack(repeat [each t]) |
| 21 | + calleeGeneric((repeat [each t])) |
18 | 22 | } |
19 | 23 |
|
20 | | -public func foo<each T: Equatable>(_: repeat each T) {} |
| 24 | +public func transparentCaller2() { |
| 25 | + transparentCaller(1, "hi", false) |
| 26 | +} |
21 | 27 |
|
22 | | -@_transparent public func bar(x: Int, y: String) { |
23 | | - foo(x, y) |
| 28 | +@_alwaysEmitIntoClient |
| 29 | +public func calleeWithRequirement<each T: Equatable>(_ t: repeat each T) { |
| 30 | + repeat ((each t) == (each t)) |
24 | 31 | } |
25 | 32 |
|
26 | 33 | #elseif APP |
27 | 34 |
|
28 | 35 | import pack_expansion_type |
29 | 36 |
|
30 | | -caller(1, "hi", false) |
31 | | -bar(x: 1, y: "hi") |
| 37 | +transparentCaller(1, "hi", false) |
| 38 | +serializedCaller(1, "hi", false) |
| 39 | +calleeWithRequirement(1, "hi") |
32 | 40 |
|
33 | 41 | #endif |
0 commit comments