Files
swift-mirror/test/Interop/Cxx/class/inheritance/subscript-irgen.swift
John Hui 1e9efd4398 [cxx-interop] Fix subscript-irgen test CHECK statement (#78299)
Previously the check statement did not account for attribute groups.
This patch adds a glob at the end of the CHECK statement to allow
trailing attribute groups, and also relaxes the pattern at the
beginning.

rdar://141662805
2024-12-19 15:59:08 -08:00

15 lines
748 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 @{{(.*)(30CopyTrackedDerivedDerivedClass39__synthesizedBaseCall_operatorSubscript|__synthesizedBaseCall_operatorSubscript@CopyTrackedDerivedDerivedClass)(.*)}}(ptr {{.*}} %[[THIS_PTR:.*]], i32 {{.*}})
// CHECK: %[[ADD_PTR:.*]] = getelementptr inbounds i8, ptr %{{.*}}, i{{32|64}} 4
// CHECK: {{.*}}call {{.*}} i32 @{{.*}}CopyTrackedBaseClass{{.*}}(ptr {{.*}} %[[ADD_PTR]], i32 {{.*}}){{.*}}