Files
swift-mirror/test/SILOptimizer/opaque_values_unit.sil
Nate Chandler c84e196b16 [Test] Reenable SIL unit tests on windows.
Use `fflush(stdout)` from C++.

Issue 73252.
2024-05-06 12:20:16 -07:00

24 lines
914 B
Plaintext

// RUN: %target-sil-opt -enable-sil-opaque-values -test-runner %s 2>&1 | %FileCheck %s
// REQUIRES: swift_in_compiler
import Builtin
class C {}
// Verify that SILFunction_getSelfArgumentIndex respects SILFunctionConventions
// and returns right value even in the presence of indirect results.
//
// CHECK-LABEL: begin running test 1 of {{[^,]+}} on f: argument_conventions
// The parameter index is 0 here when opaque values are enabled because the result
// is just returned. It could mistakenly be calculated as 1 though because
// after AddressLowering there will be a new argument at index 0 for the
// indirect result.
// CHECK: [0] parameter: directGuaranteed
// CHECK-LABEL: end running test 1 of {{[^,]+}} on f: argument_conventions
sil [ossa] @f : $@convention(method) <T> (@guaranteed C) -> @out T {
entry(%instance : @guaranteed $C):
specify_test "argument_conventions"
unreachable
}