Files
swift-mirror/test/SILGen/moveonly_subscript_addressor.swift
Kavon Farvardin d2bd562799 Test: send shadow RUN lines to /dev/null
The opaque values test coverage I initially added will emit to
stdout, which is noisy for people's logs if the test is failing for
some other reason.
2026-06-30 17:40:48 -07:00

23 lines
755 B
Swift

// RUN: %target-swift-emit-silgen-ossa -o /dev/null -enable-sil-opaque-values %s
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
struct Foo: ~Copyable {
let value: Int
@_silgen_name("load")
borrowing func load() -> Int
}
// CHECK-LABEL: sil {{.*}} @${{.*}}4load
func load(b: UnsafeMutableBufferPointer<Foo>) -> Int {
// Ensure the borrowing invocation of `load` happens within the access to
// the pointed-at memory.
// CHECK: [[PTR:%.*]] = pointer_to_address
// CHECK: [[MD:%.*]] = mark_dependence [unresolved] [[PTR]] on %0
// CHECK: [[BEGIN:%.*]] = begin_access [read] [unsafe] [[MD]]
// CHECK: [[FN:%.*]] = function_ref @load
// CHECK: apply [[FN]]
// CHECK: end_access [[BEGIN]]
return b[1].load()
}