|
2 | 2 |
|
3 | 3 | // REQUIRES: swift_feature_Extern |
4 | 4 |
|
5 | | -// CHECK-DAG: sil hidden_external @my_c_name : $@convention(c) (Int) -> Int |
| 5 | +// CHECK-DAG: sil hidden_external [asmname "my_c_name"] @$s8extern_c9withCNameyS2iFTo : $@convention(c) (Int) -> Int |
6 | 6 | @_extern(c, "my_c_name") |
7 | 7 | func withCName(_ x: Int) -> Int |
8 | 8 |
|
9 | | -// CHECK-DAG: sil hidden_external @take_c_func_ptr : $@convention(c) (@convention(c) (Int) -> Int) -> () |
| 9 | +// CHECK-DAG: sil hidden_external [asmname "take_c_func_ptr"] @$s8extern_c12takeCFuncPtryyS2iXCF : $@convention(c) (@convention(c) (Int) -> Int) -> () |
10 | 10 | @_extern(c, "take_c_func_ptr") |
11 | 11 | func takeCFuncPtr(_ f: @convention(c) (Int) -> Int) |
12 | 12 |
|
13 | | -// CHECK-DAG: sil @public_visible : $@convention(c) (Int) -> Int |
| 13 | +// CHECK-DAG: sil [asmname "public_visible"] @$s8extern_c16publicVisibilityyS2iF : $@convention(c) (Int) -> Int |
14 | 14 | @_extern(c, "public_visible") |
15 | 15 | public func publicVisibility(_ x: Int) -> Int |
16 | 16 |
|
17 | | -// CHECK-DAG: sil @private_visible : $@convention(c) (Int) -> Int |
| 17 | +// CHECK-DAG: sil [asmname "private_visible"] @$s8extern_c17privateVisibility{{.*}} : $@convention(c) (Int) -> Int |
18 | 18 | @_extern(c, "private_visible") |
19 | 19 | private func privateVisibility(_ x: Int) -> Int |
20 | 20 |
|
21 | | -// CHECK-DAG: sil hidden_external @withoutCName : $@convention(c) () -> Int |
| 21 | +// CHECK-DAG: sil hidden_external [asmname "withoutCName"] @$s8extern_c12withoutCNameSiyF : $@convention(c) () -> Int |
22 | 22 | @_extern(c) |
23 | 23 | func withoutCName() -> Int |
24 | 24 |
|
25 | 25 | // CHECK-DAG: sil hidden [ossa] @$s8extern_c10defaultArgyySiFfA_ : $@convention(thin) () -> Int { |
26 | | -// CHECK-DAG: sil hidden_external @default_arg : $@convention(c) (Int) -> () |
| 26 | +// CHECK-DAG: sil hidden_external [asmname "default_arg"] @$s8extern_c10defaultArgyySiF : $@convention(c) (Int) -> () |
27 | 27 | @_extern(c, "default_arg") |
28 | 28 | func defaultArg(_ x: Int = 42) |
29 | 29 |
|
30 | 30 | func main() { |
31 | | - // CHECK-DAG: [[F1:%.+]] = function_ref @my_c_name : $@convention(c) (Int) -> Int |
32 | | - // CHECK-DAG: [[F2:%.+]] = function_ref @take_c_func_ptr : $@convention(c) (@convention(c) (Int) -> Int) -> () |
| 31 | + // CHECK-DAG: [[F1:%.+]] = function_ref @$s8extern_c9withCNameyS2iFTo : $@convention(c) (Int) -> Int |
| 32 | + // CHECK-DAG: [[F2:%.+]] = function_ref @$s8extern_c12takeCFuncPtryyS2iXCF : $@convention(c) (@convention(c) (Int) -> Int) -> () |
33 | 33 | // CHECK-DAG: apply [[F2]]([[F1]]) : $@convention(c) (@convention(c) (Int) -> Int) -> () |
34 | 34 | takeCFuncPtr(withCName) |
35 | | - // CHECK-DAG: [[F3:%.+]] = function_ref @public_visible : $@convention(c) (Int) -> Int |
| 35 | + // CHECK-DAG: [[F3:%.+]] = function_ref @$s8extern_c16publicVisibilityyS2iF : $@convention(c) (Int) -> Int |
36 | 36 | // CHECK-DAG: apply [[F3]]({{.*}}) : $@convention(c) (Int) -> Int |
37 | 37 | _ = publicVisibility(42) |
38 | | - // CHECK-DAG: [[F4:%.+]] = function_ref @private_visible : $@convention(c) (Int) -> Int |
| 38 | + // CHECK-DAG: [[F4:%.+]] = function_ref @$s8extern_c17privateVisibility{{.*}} : $@convention(c) (Int) -> Int |
39 | 39 | // CHECK-DAG: apply [[F4]]({{.*}}) : $@convention(c) (Int) -> Int |
40 | 40 | _ = privateVisibility(24) |
41 | | - // CHECK-DAG: [[F5:%.+]] = function_ref @withoutCName : $@convention(c) () -> Int |
| 41 | + // CHECK-DAG: [[F5:%.+]] = function_ref @$s8extern_c12withoutCNameSiyF : $@convention(c) () -> Int |
42 | 42 | // CHECK-DAG: apply [[F5]]() : $@convention(c) () -> Int |
43 | 43 | _ = withoutCName() |
44 | 44 | // CHECK-DAG: [[F6:%.+]] = function_ref @$s8extern_c10defaultArgyySiFfA_ : $@convention(thin) () -> Int |
45 | 45 | // CHECK-DAG: [[DEFAULT_V:%.+]] = apply [[F6]]() : $@convention(thin) () -> Int |
46 | | - // CHECK-DAG: [[F7:%.+]] = function_ref @default_arg : $@convention(c) (Int) -> () |
| 46 | + // CHECK-DAG: [[F7:%.+]] = function_ref @$s8extern_c10defaultArgyySiF : $@convention(c) (Int) -> () |
47 | 47 | // CHECK-DAG: apply [[F7]]([[DEFAULT_V]]) : $@convention(c) (Int) -> () |
48 | 48 | defaultArg() |
49 | 49 | } |
|
0 commit comments