Files
swift-mirror/test/SILGen/borrow_from_load_expr.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

39 lines
1.6 KiB
Swift

// RUN: %target-swift-emit-silgen-ossa -o /dev/null -enable-sil-opaque-values %s
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend \
// RUN: %s \
// RUN: -Xllvm -sil-print-types -emit-silgen \
// RUN: -debug-diagnostic-names \
// RUN: -I %t \
// RUN: | \
// RUN: %FileCheck %s
public struct FA<T> {
public subscript(_ int: Int) -> T {
// CHECK-LABEL: sil [ossa] @read : {{.*}} {
// function_ref UnsafeMutablePointer.subscript.unsafeAddressor
// CHECK: [[ADDRESSOR:%[^,]+]] = function_ref @$sSpsRi_zrlEyxSicilu
// CHECK: [[POINTER:%[^,]+]] = apply [[ADDRESSOR]]
// CHECK: [[RAW_POINTER:%[^,]+]] = struct_extract [[POINTER]]
// CHECK: [[ADDR:%[^,]+]] = pointer_to_address [[RAW_POINTER]]
// CHECK: [[MD:%.*]] = mark_dependence [unresolved] [[ADDR]] : $*T
// CHECK: [[ACCESS:%[^,]+]] = begin_access [read] [unsafe] [[MD]]
// Verify that no spurious temporary is emitted.
// CHECK-NOT: alloc_stack
// CHECK: yield [[ACCESS]] : $*T, resume [[SUCCESS:bb[0-9]+]], unwind [[FAILURE:bb[0-9]+]]
// CHECK: [[SUCCESS]]:
// CHECK: end_access [[ACCESS]]
// CHECK: [[FAILURE]]:
// CHECK: end_access [[ACCESS]]
// CHECK: unwind
// CHECK-LABEL: } // end sil function 'read'
@_silgen_name("read")
_read {
yield ump[int]
}
}
var ump: UnsafeMutablePointer<T>
}