 
 class Klass {}
 
-// CHECK-LABEL: sil hidden [ossa] @$s8moveonly7useMoveyAA5KlassCADF : $@convention(thin) (@guaranteed Klass) -> @owned Klass {
+// CHECK-LABEL: sil hidden [ossa] @$s8moveonly7useMoveyAA5KlassCADnF : $@convention(thin) (@owned Klass) -> @owned Klass {
 // CHECK: bb0([[ARG:%.*]] :
+// CHECK-NEXT: [[BORROWED_ARG:%.*]] = begin_borrow [lexical] [[ARG]]
 // CHECK-NEXT: debug_value
 // CHECK-NEXT: [[RESULT_ADDR:%.*]] = alloc_stack $Klass
-// CHECK-NEXT: [[ARC_COPY:%.*]] = copy_value [[ARG]]
+// CHECK-NEXT: [[ARC_COPY:%.*]] = copy_value [[BORROWED_ARG]]
 // CHECK-NEXT: [[INPUT_ADDR:%.*]] = alloc_stack $Klass
 // CHECK-NEXT: store [[ARC_COPY]] to [init] [[INPUT_ADDR]]
 // CHECK-NEXT: // function_ref _move<A>(_:)

// CHECK-NEXT: dealloc_stack [[INPUT_ADDR]]
// CHECK-NEXT: [[RELOADED_VALUE:%.*]] = load [take] [[RESULT_ADDR]]
// CHECK-NEXT: dealloc_stack [[RESULT_ADDR]]
// CHECK-NEXT: return [[RELOADED_VALUE]]
// CHECK: } // end sil function '$s8moveonly7useMoveyxxRlzClF'

// CHECK-SIL-LABEL: sil hidden @$s8moveonly7useMoveyxxRlzClF : $@convention(thin) <T where T : AnyObject> (@guaranteed T) -> @owned T {
// CHECK-SIL: bb0([[ARG:%.*]] :
// CHECK-SIL-NEXT: debug_value
// CHECK-SIL-NEXT: strong_retain
// CHECK-SIL-NEXT: [allows_diagnostics] move_value
// CHECK-SIL-NEXT: tuple
// CHECK-SIL-NEXT: return
// CHECK-SIL: } // end sil function '$s8moveonly7useMoveyxxRlzClF'
func useMove<T : AnyObject>(_ k: T) -> T {
    _move(k)
}

// CHECK-NEXT: dealloc_stack [[INPUT_ADDR]]
// CHECK-NEXT: [[RELOADED_VALUE:%.*]] = load [take] [[RESULT_ADDR]]
// CHECK-NEXT: dealloc_stack [[RESULT_ADDR]]
// CHECK-NEXT: end_borrow [[BORROWED_ARG]]
// CHECK-NEXT: destroy_value [[ARG]]
// CHECK-NEXT: return [[RELOADED_VALUE]]
// CHECK: } // end sil function '$s8moveonly7useMoveyAA5KlassCADnF'

// CHECK-SIL-LABEL: sil hidden @$s8moveonly7useMoveyAA5KlassCADnF : $@convention(thin) (@owned Klass) -> @owned Klass {
// CHECK-SIL: bb0([[ARG:%.*]] :
// CHECK-SIL-NEXT: debug_value
// CHECK-SIL-NEXT: strong_retain
// CHECK-SIL-NEXT: move_value
// CHECK-SIL-NEXT: tuple
// CHECK-SIL-NEXT: tuple
// CHECK-SIL-NEXT: strong_release
// CHECK-SIL-NEXT: return
// CHECK-SIL: } // end sil function '$s8moveonly7useMoveyAA5KlassCADnF'
func useMove(_ k: __owned Klass) -> Klass {
    _move(k)
}

// CHECK-LABEL: sil hidden [ossa] @$s8moveonly7useMoveyxxnRlzClF : $@convention(thin) <T where T : AnyObject> (@owned T) -> @owned T {
// CHECK: bb0([[ARG:%.*]] :
// CHECK-NEXT: [[BORROWED_ARG:%.*]] = begin_borrow [lexical] [[ARG]]
// CHECK-NEXT: debug_value
// CHECK-NEXT: [[RESULT_ADDR:%.*]] = alloc_stack $T
// CHECK-NEXT: [[ARC_COPY:%.*]] = copy_value [[BORROWED_ARG]]
// CHECK-NEXT: [[INPUT_ADDR:%.*]] = alloc_stack $T
// CHECK-NEXT: store [[ARC_COPY]] to [init] [[INPUT_ADDR]]
// CHECK-NEXT: // function_ref _move<A>(_:)
