mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
24 lines
914 B
Plaintext
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
|
|
}
|