Files
swift-mirror/test/Interop/SwiftToCxx/structs/swift-struct-circular-dependent-defs.swift
Alex Lorenz 3948a2a5d3 [interop][SwiftToCxx] annotate inline thunks with SWIFT_INLINE_THUNK
This macro applies always_inline in addition to inline. It also applies artificial, which lets debugger know that this is an artificial function. The used attribute is added in debug builds to ensure that the symbol is emitted in the binary so that LLDB can invoke it.
2023-02-24 11:23:46 -08:00

49 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -typecheck -module-name Structs -clang-header-expose-decls=all-public -emit-clang-header-path %t/structs.h
// RUN: %FileCheck %s < %t/structs.h
// RUN: %check-interop-cxx-header-in-clang(%t/structs.h)
struct Large {
let x: (Int64, Int64, Int64, Int64, Int64, Int64) = (0, 0, 0, 0, 0, 0)
}
public struct A {
public func returnsB() -> B {
return B()
}
let v: Large = Large()
}
public struct B {
public func returnsA() -> A {
return A()
}
let v: Large = Large()
}
// CHECK: class SWIFT_SYMBOL({{.*}}) B;
// CHECK: class SWIFT_SYMBOL({{.*}}) A;
// CHECK: namespace _impl {
// CHECK-EMPTY:
// CHECK-NEXT: class _impl_A;
// CHECK: class SWIFT_SYMBOL({{.*}}) A final {
// CHECK: B returnsB() const SWIFT_SYMBOL({{.*}});
// CHECK: namespace _impl {
// CHECK-EMPTY:
// CHECK-NEXT: class _impl_A {
// CHECK: namespace _impl {
// CHECK-EMPTY:
// CHECK-NEXT: class _impl_B;
// CHECK: class SWIFT_SYMBOL({{.*}}) B final {
// CHECK: SWIFT_INLINE_THUNK B A::returnsB() const {
// CHECK: SWIFT_INLINE_THUNK A B::returnsA() const {