mirror of
https://github.com/apple/swift.git
synced 2026-10-26 20:15:53 +01:00
The implementation for this behavior was added in a previous patch; this patch integrates and removes unused call sites. This patch also adds some tests exercising the overloading behavior. Annoyingly, imported members that point to the same source location aren't sorted correctly in the module interface, so this changes the order in a bunch of module interface tests. rdar://170857428 Also, un-comment broken test case of using Base::operator[], which is fixed by this commit. rdar://145345345
15 lines
639 B
Swift
15 lines
639 B
Swift
// RUN: %target-swift-emit-irgen -I %S/Inputs -enable-experimental-cxx-interop %s -validate-tbd-against-ir=none -Xcc -fignore-exceptions | %FileCheck %s
|
|
|
|
import Subscripts
|
|
|
|
func testGetX() -> CInt {
|
|
let derivedDerived = CopyTrackedDerivedDerivedClass(42)
|
|
return derivedDerived[0]
|
|
}
|
|
|
|
let _ = testGetX()
|
|
|
|
// CHECK: define {{.*}}linkonce_odr{{.*}} i32 @{{.*}}synthesizedBaseCall_operatorSubscript{{.*}}(ptr {{.*}} %[[THIS_PTR:.*]], i32 {{.*}})
|
|
// CHECK: %[[ADD_PTR:.*]] = getelementptr inbounds i8, ptr %{{.*}}, i{{32|64}} 4
|
|
// CHECK: {{.*}}call {{.*}} i32 @{{.*}}CopyTrackedBaseClass{{.*}}(ptr {{.*}} %[[ADD_PTR]], i32 {{.*}}){{.*}}
|