11// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=ONONE
2- // R/UN : %target-swift-frontend -O -disable-llvm-optzns -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=ONONE
2+ // RUN : %target-swift-frontend -O -disable-llvm-optzns -Xllvm -sil-disable-pass=FunctionSignatureOpts - emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=O
33
44@_silgen_name ( " useMetadata " )
55func useMetadata< T> ( _: T . Type )
@@ -25,7 +25,7 @@ private class PrivateNonfinal<T, U, V> {
2525
2626 // Methods in general on nonfinal classes cannot use the self metadata as
2727 // is.
28- // CHECK-LABEL: define {{.*}}15PrivateNonfinal{{.*}}buttsyyF"
28+ // CHECK-LABEL: define {{.*}}15PrivateNonfinal{{.*}}buttsyyF{{.*}} "
2929 @inline ( never)
3030 final func butts( ) {
3131 // CHECK: [[INSTANTIATED_TYPE_RESPONSE:%.*]] = call {{.*}} @{{.*}}15PrivateNonfinal{{.*}}Ma
@@ -46,19 +46,25 @@ private class PrivateNonfinal<T, U, V> {
4646// should figure out that it's effectively final because it has no
4747// subclasses.
4848private class PrivateNonfinalSubclass : PrivateNonfinal < Int , String , Float > {
49+ // CHECK-O-LABEL: define {{.*}}PrivateNonfinalSubclass{{.*}}cfC
50+ // CHECK-O: call {{.*}}@swift_allocObject(%swift.type* %0
51+
4952 @inline ( never)
5053 final func borts( ) {
5154 useMetadata ( PrivateNonfinalSubclass . self)
5255 }
5356
54- // CHECK-LABEL: define {{.*}}PrivateNonfinalSubclass{{.*}}cfC
55- // CHECK: call {{.*}}@swift_allocObject(%swift.type* %0
57+ // CHECK-ONONE- LABEL: define {{.*}}PrivateNonfinalSubclass{{.*}}cfC
58+ // CHECK-ONONE : call {{.*}}@swift_allocObject(%swift.type* %0
5659}
5760
5861final private class FinalPrivateNonfinalSubclass < U> : PrivateNonfinal < U , String , Float > {
5962 // The class is final, so we can always form metadata for
6063 // FinalPrivateNonfinalSubclass<U> from the self argument.
6164
65+ // CHECK-O-LABEL: define {{.*}}FinalPrivateNonfinalSubclass{{.*}}cfC"
66+ // CHECK-O: call {{.*}}@swift_allocObject(%swift.type* %0
67+
6268 // CHECK-LABEL: define {{.*}}FinalPrivateNonfinalSubclass{{.*}}burts
6369 @inline ( never)
6470 final func burts( ) {
@@ -71,10 +77,13 @@ final private class FinalPrivateNonfinalSubclass<U>: PrivateNonfinal<U, String,
7177 useMetadata ( FinalPrivateNonfinalSubclass< Int> . self )
7278 }
7379
74- // CHECK-LABEL: define {{.*}}FinalPrivateNonfinalSubclass{{.*}}cfC"
75- // CHECK: call {{.*}}@swift_allocObject(%swift.type* %0
80+ // CHECK-ONONE- LABEL: define {{.*}}FinalPrivateNonfinalSubclass{{.*}}cfC"
81+ // CHECK-ONONE : call {{.*}}@swift_allocObject(%swift.type* %0
7682}
7783
84+ // CHECK-O-LABEL: define {{.*}}FinalPrivateNonfinalSubclass{{.*}}cfC"
85+ // CHECK-O: call {{.*}}@swift_allocObject(%swift.type* %0
86+
7887final private class PrivateFinal < T, U, V> {
7988 // The class is final, so we can always form metadata for
8089 // PrivateFinal<T, U, V> from the self argument.
0 commit comments