3
3
import DependentTypes
4
4
5
5
// Check the test function:
6
- // CHECK-LABEL: sil [ossa] @$s4main4testSiyF : $@convention(thin) () -> Int
6
+ // CHECK-LABEL: sil [ossa] @$s4main4tests5Int64VyF : $@convention(thin) () -> Int64
7
7
// CHECK: [[ANY_OUT:%.*]] = alloc_stack $Any
8
8
9
- // CHECK: [[THUNK_REF:%.*]] = function_ref @$sSC27dependantReturnTypeInfferedyypSiF : $@convention(thin) (Int ) -> @out Any
10
- // CHECK: apply [[THUNK_REF]]([[ANY_OUT]], %{{[0-9]+}}) : $@convention(thin) (Int ) -> @out Any
9
+ // CHECK: [[THUNK_REF:%.*]] = function_ref @$sSC27dependantReturnTypeInfferedyyps5Int64VF : $@convention(thin) (Int64 ) -> @out Any
10
+ // CHECK: apply [[THUNK_REF]]([[ANY_OUT]], %{{[0-9]+}}) : $@convention(thin) (Int64 ) -> @out Any
11
11
12
- // CHECK: [[SPEC_OUT:%.*]] = alloc_stack $__CxxTemplateInst1MIlE
13
- // CHECK: unconditional_checked_cast_addr Any in [[ANY_OUT]] : $*Any to __CxxTemplateInst1MIlE in [[SPEC_OUT]] : $*__CxxTemplateInst1MIlE
14
- // CHECK: [[SPEC_VAL:%.*]] = load [trivial] [[SPEC_OUT]] : $*__CxxTemplateInst1MIlE
12
+ // CHECK: [[SPEC_OUT:%.*]] = alloc_stack $__CxxTemplateInst1MIxE
13
+ // CHECK: unconditional_checked_cast_addr Any in [[ANY_OUT]] : $*Any to __CxxTemplateInst1MIxE in [[SPEC_OUT]] : $*__CxxTemplateInst1MIxE
14
+ // CHECK: [[SPEC_VAL:%.*]] = load [trivial] [[SPEC_OUT]] : $*__CxxTemplateInst1MIxE
15
15
16
- // CHECK: [[SPEC_TEMP:%.*]] = alloc_stack $__CxxTemplateInst1MIlE
17
- // CHECK: store [[SPEC_VAL]] to [trivial] [[SPEC_TEMP]] : $*__CxxTemplateInst1MIlE
16
+ // CHECK: [[SPEC_TEMP:%.*]] = alloc_stack $__CxxTemplateInst1MIxE
17
+ // CHECK: store [[SPEC_VAL]] to [trivial] [[SPEC_TEMP]] : $*__CxxTemplateInst1MIxE
18
18
19
- // CHECK: [[GET_VAL_FN:%.*]] = function_ref @{{_ZNK1MIlE8getValueEv |\?getValue@\?\$M@_J@@QEBA_JXZ}} : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIlE ) -> Int
20
- // CHECK: [[OUT_VAL:%.*]] = apply [[GET_VAL_FN]]([[SPEC_TEMP]]) : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIlE ) -> Int
19
+ // CHECK: [[GET_VAL_FN:%.*]] = function_ref @{{_ZNK1MIxE8getValueEv |\?getValue@\?\$M@_J@@QEBA_JXZ}} : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIxE ) -> Int
20
+ // CHECK: [[OUT_VAL:%.*]] = apply [[GET_VAL_FN]]([[SPEC_TEMP]]) : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIxE ) -> Int
21
21
22
22
// CHECK: return [[OUT_VAL]] : $Int
23
- // CHECK-LABEL: end sil function '$s4main4testSiyF '
23
+ // CHECK-LABEL: end sil function '$s4main4tests5Int64VyF '
24
24
25
25
26
26
// Check the synthesized thunk:
27
- // CHECK-LABEL: sil [transparent] [serialized] [ossa] @$sSC27dependantReturnTypeInfferedyypSiF : $@convention(thin) (Int ) -> @out Any
28
- // CHECK: bb0(%0 : $*Any, %1 : $Int ):
29
- // CHECK: [[SPEC_OUT:%.*]] = alloc_stack $__CxxTemplateInst1MIlE
30
- // CHECK: [[TMP_INT:%.*]] = alloc_stack $Int
31
- // CHECK: store %1 to [trivial] [[TMP_INT]] : $*Int
32
- // CHECK: [[TMP_INT_CASTED:%.*]] = alloc_stack $Int
33
- // CHECK: unconditional_checked_cast_addr Int in [[TMP_INT]] : $*Int to Int in [[TMP_INT_CASTED]] : $*Int
34
-
35
- // CHECK: [[ARG:%.*]] = load [trivial] [[TMP_INT_CASTED]] : $*Int
36
- // CHECK: [[FN:%.*]] = function_ref @{{_Z27dependantReturnTypeInfferedIlE1MIT_ES1_ |\?\?\$dependantReturnTypeInffered@_J@@YA?AU\?\$M@_J@@_J@Z}} : $@convention(c) (Int ) -> __CxxTemplateInst1MIlE
37
- // CHECK: [[OUT:%.*]] = apply [[FN]]([[ARG]]) : $@convention(c) (Int ) -> __CxxTemplateInst1MIlE
38
-
39
- // CHECK: store [[OUT]] to [trivial] [[SPEC_OUT]] : $*__CxxTemplateInst1MIlE
40
- // CHECK: unconditional_checked_cast_addr __CxxTemplateInst1MIlE in [[SPEC_OUT]] : $*__CxxTemplateInst1MIlE to Any in %0 : $*Any
41
- // CHECK-LABEL: end sil function '$sSC27dependantReturnTypeInfferedyypSiF '
42
-
43
- public func test( ) -> Int {
44
- let m = dependantReturnTypeInffered ( 42 ) as! M < Int >
27
+ // CHECK-LABEL: sil [transparent] [serialized] [ossa] @$sSC27dependantReturnTypeInfferedyyps5Int64VF : $@convention(thin) (Int64 ) -> @out Any
28
+ // CHECK: bb0(%0 : $*Any, %1 : $Int64 ):
29
+ // CHECK: [[SPEC_OUT:%.*]] = alloc_stack $__CxxTemplateInst1MIxE
30
+ // CHECK: [[TMP_INT:%.*]] = alloc_stack $Int64
31
+ // CHECK: store %1 to [trivial] [[TMP_INT]] : $*Int64
32
+ // CHECK: [[TMP_INT_CASTED:%.*]] = alloc_stack $Int64
33
+ // CHECK: unconditional_checked_cast_addr Int64 in [[TMP_INT]] : $*Int64 to Int64 in [[TMP_INT_CASTED]] : $*Int64
34
+
35
+ // CHECK: [[ARG:%.*]] = load [trivial] [[TMP_INT_CASTED]] : $*Int64
36
+ // CHECK: [[FN:%.*]] = function_ref @{{_Z27dependantReturnTypeInfferedIxE1MIT_ES1_ |\?\?\$dependantReturnTypeInffered@_J@@YA\ ?AU\?\$M@_J@@_J@Z}} : $@convention(c) (Int64 ) -> __CxxTemplateInst1MIxE
37
+ // CHECK: [[OUT:%.*]] = apply [[FN]]([[ARG]]) : $@convention(c) (Int64 ) -> __CxxTemplateInst1MIxE
38
+
39
+ // CHECK: store [[OUT]] to [trivial] [[SPEC_OUT]] : $*__CxxTemplateInst1MIxE
40
+ // CHECK: unconditional_checked_cast_addr __CxxTemplateInst1MIxE in [[SPEC_OUT]] : $*__CxxTemplateInst1MIxE to Any in %0 : $*Any
41
+ // CHECK-LABEL: end sil function '$sSC27dependantReturnTypeInfferedyyps5Int64VF '
42
+
43
+ public func test( ) -> Int64 {
44
+ let m = dependantReturnTypeInffered ( Int64 ( 42 ) ) as! M < Int64 >
45
45
return m. getValue ( )
46
46
}
47
47
48
- // CHECK-LABEL: sil [clang __CxxTemplateInst1MIlE .getValue] @{{_ZNK1MIlE8getValueEv |\?getValue@\?\$M@_J@@QEBA_JXZ}} : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIlE ) -> Int
49
- // CHECK-LABEL: sil [serializable] [clang dependantReturnTypeInffered] @{{_Z27dependantReturnTypeInfferedIlE1MIT_ES1_ |\?\?\$dependantReturnTypeInffered@_J@@YA?AU\?\$M@_J@@_J@Z}} : $@convention(c) (Int ) -> __CxxTemplateInst1MIlE
48
+ // CHECK-LABEL: sil [clang __CxxTemplateInst1MIxE .getValue] @{{_ZNK1MIxE8getValueEv |\?getValue@\?\$M@_J@@QEBA_JXZ}} : $@convention(cxx_method) (@in_guaranteed __CxxTemplateInst1MIxE ) -> Int64
49
+ // CHECK-LABEL: sil [serializable] [clang dependantReturnTypeInffered] @{{_Z27dependantReturnTypeInfferedIxE1MIT_ES1_ |\?\?\$dependantReturnTypeInffered@_J@@YA\ ?AU\?\$M@_J@@_J@Z}} : $@convention(c) (Int64 ) -> __CxxTemplateInst1MIxE
0 commit comments