mirror of
https://github.com/apple/swift.git
synced 2026-10-24 20:15:56 +02:00
These were previously in the class/inheritance subdirectory and tested a handful of subscript inheritance scenarios, but the test coverage should be expanded and consolidated with the subscript tests currently in operator/members-inline*.
16 lines
732 B
Swift
16 lines
732 B
Swift
// RUN: %target-swift-emit-sil -I %S/Inputs -enable-experimental-cxx-interop %s -validate-tbd-against-ir=none | %FileCheck %s
|
|
|
|
import Subscripts
|
|
|
|
func testGetX() -> CInt {
|
|
let derived = CopyTrackedDerivedClass(42)
|
|
return derived[0]
|
|
}
|
|
|
|
let _ = testGetX()
|
|
|
|
// CHECK: sil shared [transparent] @$sSo23CopyTrackedDerivedClassVys5Int32VADcig : $@convention(method) (Int32, @in_guaranteed CopyTrackedDerivedClass) -> Int32
|
|
// CHECK: {{.*}}(%[[INT_VAL:.*]] : $Int32, %[[SELF_VAL:.*]] : $*CopyTrackedDerivedClass):
|
|
// CHECK: function_ref @{{.*}}__synthesizedBaseCall_operatorSubscript{{.*}} : $@convention(cxx_method) (Int32, @in_guaranteed CopyTrackedDerivedClass) -> Int32
|
|
// CHECK-NEXT: apply %{{.*}}(%[[INT_VAL]], %[[SELF_VAL]])
|