@@ -16,7 +16,7 @@ import Swift
16
16
// CHECK-NEXT: %0 = argument of bb0
17
17
// CHECK-NEXT: %1 = argument of bb0
18
18
// CHECK-NEXT: NoAlias
19
- sil @address_args_dont_alias_in_first_bb : $@convention(thin) (@inout Builtin.NativeObject, @inout Builtin.NativeObject) -> () {
19
+ sil @address_args_dont_alias_in_first_bb : $@convention(thin) (@in Builtin.NativeObject, @in Builtin.NativeObject) -> () {
20
20
bb0(%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject):
21
21
%2 = tuple()
22
22
return %2 : $()
@@ -37,6 +37,19 @@ bb1(%1 : $*Builtin.NativeObject, %2 : $*Builtin.NativeObject):
37
37
return %3 : $()
38
38
}
39
39
40
+ // Assume that inout arguments alias to preserve memory safety.
41
+ //
42
+ // CHECK-LABEL: @inout_args_may_alias
43
+ // CHECK: PAIR #1.
44
+ // CHECK-NEXT: %0 = argument of bb0
45
+ // CHECK-NEXT: %1 = argument of bb0
46
+ // CHECK-NEXT: MayAlias
47
+ sil @inout_args_may_alias: $@convention(thin) (@inout Builtin.NativeObject, @inout Builtin.NativeObject) -> () {
48
+ bb0(%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject):
49
+ %2 = tuple()
50
+ return %2 : $()
51
+ }
52
+
40
53
struct StructLvl2 {
41
54
var tup : (Builtin.Int64, Builtin.Int32)
42
55
}
@@ -200,7 +213,7 @@ sil @different_alloc_stack_dont_alias : $@convention(thin) () -> () {
200
213
// CHECK-NEXT: (0): %2 = argument of bb0 : $*Builtin.NativeObject
201
214
// CHECK-NEXT: (1): %3 = alloc_stack $Builtin.NativeObject
202
215
// CHECK-NEXT: NoAlias
203
- sil @args_dont_alias_with_identified_function_locals : $@convention(thin) (Builtin.NativeObject, Builtin.NativeObject, @inout Builtin.NativeObject) -> () {
216
+ sil @args_dont_alias_with_identified_function_locals : $@convention(thin) (Builtin.NativeObject, Builtin.NativeObject, @in Builtin.NativeObject) -> () {
204
217
bb0(%0 : $Builtin.NativeObject, %1 : $Builtin.NativeObject, %2 : $*Builtin.NativeObject):
205
218
%3 = alloc_stack $Builtin.NativeObject
206
219
dealloc_stack %3#0 : $*@local_storage Builtin.NativeObject
0 commit comments