File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
test/IRGen/prespecialized-metadata Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %swift -prespecialize-generic-metadata -target %module-target-future -emit-ir %s | %FileCheck %s -DINT=i%target-ptrsize -DALIGNMENT=%target-alignment
2+
3+ // REQUIRES: VENDOR=apple || OS=linux-gnu
4+ // UNSUPPORTED: CPU=i386 && OS=ios
5+ // UNSUPPORTED: CPU=armv7 && OS=ios
6+ // UNSUPPORTED: CPU=armv7s && OS=ios
7+
8+ @inline ( never)
9+ func consume< T> ( _ t: T ) {
10+ withExtendedLifetime ( t) { t in
11+ }
12+ }
13+
14+ struct Container < T> {
15+ struct NonFixed {
16+
17+ init ( _ t: T ) {
18+ w = t
19+ }
20+
21+ var w : T ? = nil
22+ var x = 1
23+ var y = 1
24+ var z = 1
25+ }
26+ }
27+
28+
29+ func doit2( ) {
30+ consume ( Container . NonFixed ( 5 ) )
31+ }
32+
33+ doit2 ( )
34+
35+ // Make sure we use the generic witness table functions rather than specialized
36+ // ones. We do this for code size.
37+
38+ // CHECK: @"$s10nestedtype9ContainerV8NonFixedVySi_GWV" =
39+ // CHECK-SAME: s10nestedtype9ContainerV8NonFixedVwtk
You can’t perform that action at this time.
0 commit comments