1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
// RUN: %empty-directory(%t)
// RUN: %{python} %utils/chex.py < %s > %t/checkfile
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-ir -o - -primary-file %s -import-objc-header %S/Inputs/error_domains.h > %t/out.ir
// RUN: %FileCheck --input-file=%t/out.ir %t/checkfile --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize -DINT=i%target-ptrsize
// REQUIRES: objc_codegen
sil_stage canonical
import Swift
import Foundation
sil public_external @take_metatype : $@convention(thin) <T> (@thick T.Type) -> ()
sil @use_metatypes : $@convention(thin) () -> () {
bb0:
%take = function_ref @take_metatype : $@convention(thin) <T> (@thick T.Type) -> ()
// CHECK: @"$sSo18NestedTypedefErroraMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0012>
// CHECK-SAME: @"$sSoMXM"
// CHECK-SAME: ptr @.str.28.Code_NNestedTypedefError_St_.nul12.nul32.nul35
// CHECK: @"$sSC14NestedTagErrorLeVMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0011>
// CHECK-SAME: @"$sSCMXM"
// CHECK-SAME: ptr @.str.28.TagError_NNestedTagError_Re_.nul16.nul32.nul35
// CHECK: @"$sSo13TypedefError2aMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0012>
// CHECK-SAME: @"$sSoMXM"
// CHECK-SAME: ptr @.str.23.Code_NTypedefError2_St_.nul12.nul27.nul30
// CHECK: @"$sSC13TypedefError1LEVMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0011>
// CHECK-SAME: @"$sSCMXM"
// CHECK-SAME: ptr @.str.17.TypedefError1_RE_.nul21.nul24
// CHECK: @"$sSo9TagError2VMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0012>
// CHECK-SAME: @"$sSoMXM"
// CHECK-SAME: ptr @.str.16.Code_NTagError2_.nul12.nul23
// CHECK: @"$sSC9TagError1LeVMn" = linkonce_odr hidden constant
// CHECK-SAME: <i32 0x0006_0011>
// CHECK-SAME: @"$sSCMXM"
// CHECK-SAME: ptr @.str.13.TagError1_Re_.nul17.nul20
%0 = metatype $@thick TagError1.Type
apply %take<TagError1>(%0) : $@convention(thin) <T> (@thick T.Type) -> ()
%1 = metatype $@thick TagError2.Code.Type
apply %take<TagError2.Code>(%1) : $@convention(thin) <T> (@thick T.Type) -> ()
%2 = metatype $@thick TypedefError1.Type
apply %take<TypedefError1>(%2) : $@convention(thin) <T> (@thick T.Type) -> ()
%3 = metatype $@thick TypedefError2.Code.Type
apply %take<TypedefError2.Code>(%3) : $@convention(thin) <T> (@thick T.Type) -> ()
%4 = metatype $@thick Nested.TagError.Type
apply %take<Nested.TagError>(%4) : $@convention(thin) <T> (@thick T.Type) -> ()
%5 = metatype $@thick Nested.TypedefError.Code.Type
apply %take<Nested.TypedefError.Code>(%5) : $@convention(thin) <T> (@thick T.Type) -> ()
%ret = tuple ()
return %ret : $()
}
|