-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathfunction_argument_lifetime_annotation.sil
52 lines (45 loc) · 2.16 KB
/
function_argument_lifetime_annotation.sil
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
// RUN: %target-sil-opt -enable-objc-interop -enable-lexical-lifetimes=true -enable-sil-verify-all=true %s | %target-sil-opt -enable-objc-interop -enable-lexical-lifetimes=true -enable-sil-verify-all=true | %FileCheck %s
sil_stage canonical
class C {}
// CHECK-LABEL: sil [ossa] @one_arg_eager_move : {{.*}} {
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @_eagerMove @owned $C):
// CHECK-LABEL: } // end sil function 'one_arg_eager_move'
sil [ossa] @one_arg_eager_move : $@convention(thin) (@owned C) -> () {
bb0(%instance : @_eagerMove @owned $C):
destroy_value %instance : $C
%retval = tuple()
return %retval : $()
}
// CHECK-LABEL: sil [ossa] @one_arg_eager_move_and_consumable_and_assignable : {{.*}} {
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @noImplicitCopy @_eagerMove @owned $C):
// CHECK-LABEL: } // end sil function 'one_arg_eager_move_and_consumable_and_assignable'
sil [ossa] @one_arg_eager_move_and_consumable_and_assignable : $(@owned C) -> () {
bb0(%instance : @noImplicitCopy @_eagerMove @owned $C):
destroy_value %instance : $C
%retval = tuple()
return %retval : $()
}
// CHECK-LABEL: sil [ossa] @one_arg_lexical : {{.*}} {
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @_lexical @owned $C):
// CHECK-LABEL: } // end sil function 'one_arg_lexical'
sil [ossa] @one_arg_lexical : $@convention(thin) (@owned C) -> () {
bb0(%instance : @_lexical @owned $C):
destroy_value %instance : $C
%retval = tuple()
return %retval : $()
}
// CHECK-LABEL: sil [ossa] @one_arg_lexical_and_consumable_and_assignable : {{.*}} {
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @noImplicitCopy @_lexical @owned $C):
// CHECK-LABEL: } // end sil function 'one_arg_lexical_and_consumable_and_assignable'
sil [ossa] @one_arg_lexical_and_consumable_and_assignable : $@convention(thin) (@owned C) -> () {
bb0(%instance : @noImplicitCopy @_lexical @owned $C):
destroy_value %instance : $C
%retval = tuple()
return %retval : $()
}
// CHECK-LABEL: sil [lexical_lifetimes] [ossa] @force_lexical_function : {{.*}} {
// CHECK-LABEL: } // end sil function 'force_lexical_function'
sil [lexical_lifetimes] [ossa] @force_lexical_function : $@convention(thin) () -> () {
%retval = tuple()
return %retval : $()
}