Skip to content

Commit 4b3e110

Browse files
committed
[NFC] Test: Combined test.
Addressed this TODO: `Once move only is no longer behind a feature flag, merge this into basic2.`
1 parent 53fc0cb commit 4b3e110

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

test/SIL/Parser/basic2.sil

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
import Builtin
44

5+
class Klass {}
6+
@_moveOnly struct MoveOnlyPair {
7+
var lhs: Klass
8+
var rhs: Klass
9+
}
10+
511
// CHECK-LABEL: sil [ossa] @test_copy_release_value
612
// CHECK: bb0([[T0:%[0-9]+]] : @owned $Builtin.NativeObject):
713
// CHECK-NEXT: [[COPY_RESULT:%.*]] = copy_value [[T0]] : $Builtin.NativeObject
@@ -301,3 +307,26 @@ bb0(%0 : @owned $Builtin.NativeObject, %1 : @owned $Builtin.NativeObject):
301307
%9999 = tuple()
302308
return %9999 : $()
303309
}
310+
311+
// CHECK-LABEL: sil [ossa] @testMarkUnresolvedNonCopyableValueInst : $@convention(thin) (@guaranteed Klass) -> () {
312+
// CHECK: mark_unresolved_non_copyable_value [consumable_and_assignable] %{{[0-9]+}} : $*MoveOnlyPair
313+
// CHECK: } // end sil function 'testMarkUnresolvedNonCopyableValueInst'
314+
sil [ossa] @testMarkUnresolvedNonCopyableValueInst : $@convention(thin) (@guaranteed Klass) -> () {
315+
bb0(%0 : @guaranteed $Klass):
316+
%1 = alloc_box ${ var MoveOnlyPair }
317+
%2 = project_box %1 : ${ var MoveOnlyPair }, 0
318+
%3 = mark_unresolved_non_copyable_value [consumable_and_assignable] %2 : $*MoveOnlyPair
319+
%3c = begin_access [modify] [static] %3 : $*MoveOnlyPair
320+
%3a = struct_element_addr %3c : $*MoveOnlyPair, #MoveOnlyPair.lhs
321+
%3b = struct_element_addr %3c : $*MoveOnlyPair, #MoveOnlyPair.rhs
322+
%0a = copy_value %0 : $Klass
323+
%0b = copy_value %0 : $Klass
324+
store %0a to [init] %3a : $*Klass
325+
store %0b to [init] %3b : $*Klass
326+
end_access %3c : $*MoveOnlyPair
327+
328+
destroy_value %1 : ${ var MoveOnlyPair }
329+
330+
%9999 = tuple()
331+
return %9999 : $()
332+
}

test/SIL/Parser/basic2_moveonly.sil

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)