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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
// RUN: %target-swift-frontend -Xllvm -sil-disable-pass=simplification -emit-ir %s | %FileCheck %s --check-prefix=WMO --check-prefix=CHECK
// RUN: %target-swift-frontend -Xllvm -sil-disable-pass=simplification -emit-ir -primary-file %s | %FileCheck %s --check-prefix=PRIMARY --check-prefix=CHECK
sil_stage canonical
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @public_fragile_function_test() {{.*}} {
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @public_transparent_fragile_function_test() {{.*}} {
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @public_transparent_function_test() {{.*}} {
// PRIMARY: define weak_odr hidden swiftcc void @public_non_abi_function_test() {{.*}} {
// WMO: define linkonce_odr hidden swiftcc void @public_non_abi_function_test() {{.*}} {
// CHECK: define linkonce_odr hidden swiftcc void @shared_fragile_function_test() {{.*}} {
// Public external functions are not emitted into clients.
// CHECK: declare{{( dllimport)?}} swiftcc void @public_external_fragile_function_def_test()
// CHECK: define{{( protected)?}}{{( dllexport)?}} swiftcc void @public_resilient_function_test() {{.*}} {
// CHECK: define hidden swiftcc void @hidden_resilient_function_test() {{.*}} {
// CHECK: define linkonce_odr hidden swiftcc void @shared_resilient_function_test() {{.*}} {
// CHECK: define internal swiftcc void @private_resilient_function_test() {{.*}}{
// Public external functions are not emitted into clients.
// CHECK: declare{{( dllimport)?}} swiftcc void @public_external_resilient_function_def_test()
sil public [serialized] @public_fragile_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public [transparent] [serialized] @public_transparent_fragile_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public [transparent] @public_transparent_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil non_abi [serialized] @public_non_abi_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil shared [serialized] @shared_fragile_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public_external [serialized] @public_external_fragile_function_def_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public_external [serialized] @public_external_fragile_function_decl_test : $@convention(thin) () -> ()
sil hidden_external [serialized] @hidden_external_fragile_function_decl_test : $@convention(thin) () -> ()
// 'shared' should always be a definition.
// sil shared_external [serialized] @shared_external_fragile_function_decl_test : $@convention(thin) () -> ()
// 'private' should always be a definition.
// sil private_external [serialized] @private_external_fragile_function_decl_test : $@convention(thin) () -> ()
sil public @public_resilient_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil hidden @hidden_resilient_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil shared @shared_resilient_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil private @private_resilient_function_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
sil public_external [serialized] @public_external_resilient_function_def_test : $@convention(thin) () -> () {
%0 = tuple()
return %0 : $()
}
// 'private_external' should always be fragile.
// sil private_external @private_external_resilient_function_def_test : $@convention(thin) () -> () {
// %0 = tuple()
// return %0 : $()
// }
sil public_external @public_external_resilient_function_decl_test : $@convention(thin) () -> ()
sil hidden_external @hidden_external_resilient_function_decl_test : $@convention(thin) () -> ()
// 'shared' should always be a definition.
// sil shared_external @shared_external_resilient_function_decl_test : $@convention(thin) () -> ()
// 'private' should always be a definition.
// sil private_external @private_external_resilient_function_decl_test : $@convention(thin) () -> ()
sil public @use_all_symbols : $@convention(thin) () -> () {
%0 = function_ref @public_fragile_function_test : $@convention(thin) () -> ()
%t0 = function_ref @public_transparent_fragile_function_test : $@convention(thin) () -> ()
%t1 = function_ref @public_transparent_function_test : $@convention(thin) () -> ()
%t2 = function_ref @public_non_abi_function_test : $@convention(thin) () -> ()
%2 = function_ref @shared_fragile_function_test : $@convention(thin) () -> ()
%4 = function_ref @public_external_fragile_function_def_test : $@convention(thin) () -> ()
%8 = function_ref @public_external_fragile_function_decl_test : $@convention(thin) () -> ()
%9 = function_ref @hidden_external_fragile_function_decl_test : $@convention(thin) () -> ()
// %10 = function_ref @shared_external_fragile_function_decl_test : $@convention(thin) () -> ()
// %11 = function_ref @private_external_fragile_function_decl_test : $@convention(thin) () -> ()
%12 = function_ref @public_resilient_function_test : $@convention(thin) () -> ()
%13 = function_ref @hidden_resilient_function_test : $@convention(thin) () -> ()
%14 = function_ref @shared_resilient_function_test : $@convention(thin) () -> ()
%15 = function_ref @private_resilient_function_test : $@convention(thin) () -> ()
%16 = function_ref @public_external_resilient_function_def_test : $@convention(thin) () -> ()
// %19 = function_ref @private_external_resilient_function_def_test : $@convention(thin) () -> ()
%20 = function_ref @public_external_resilient_function_decl_test : $@convention(thin) () -> ()
%21 = function_ref @hidden_external_resilient_function_decl_test : $@convention(thin) () -> ()
// %22 = function_ref @shared_external_resilient_function_decl_test : $@convention(thin) () -> ()
// %23 = function_ref @private_external_resilient_function_decl_test : $@convention(thin) () -> ()
apply %0() : $@convention(thin) () -> ()
apply %2() : $@convention(thin) () -> ()
apply %4() : $@convention(thin) () -> ()
apply %8() : $@convention(thin) () -> ()
apply %9() : $@convention(thin) () -> ()
// apply %10() : $@convention(thin) () -> ()
// apply %11() : $@convention(thin) () -> ()
apply %12() : $@convention(thin) () -> ()
apply %13() : $@convention(thin) () -> ()
apply %14() : $@convention(thin) () -> ()
apply %15() : $@convention(thin) () -> ()
apply %16() : $@convention(thin) () -> ()
// apply %19() : $@convention(thin) () -> ()
apply %20() : $@convention(thin) () -> ()
apply %21() : $@convention(thin) () -> ()
// apply %22() : $@convention(thin) () -> ()
// apply %23() : $@convention(thin) () -> ()
%24 = tuple()
return %24 : $()
}
|