Files
Nuri Amari dd2168e76e Introduce logic to schedule serialization of hidden types
We introduce a reachability analysis during serialization that schedules
types from @_implementationOnly imports, or from
-internal-import-bridging-header that affect the ABI of the module for a
hidden representation. We also introduce remarks during this process
that explain why a given declaration scheduled.
2026-09-02 11:20:36 -04:00

21 lines
1.2 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -enable-experimental-com-interop -module-name COM -emit-module-path %t/COM.swiftmodule %S/../Inputs/COM.swift
// RUN: %target-swift-frontend -enable-experimental-com-interop -module-name serialization -emit-module-path %t/serialization.swiftmodule %s -I %t
// RUN: %llvm-bcanalyzer -dump %t/serialization.swiftmodule | %FileCheck -check-prefix CHECK -implicit-check-not UnknownCode %s
@com(interface: "00000000-0000-0000-C000-000000000046")
public protocol IUnknown: AnyObject { }
// CHECK-DAG: <COM_DECL_ATTR abbrevid={{[0-9]+}} op0=0 op1=1 op2=0/> blob data = '00000000-0000-0000-C000-000000000046'
@com(implementation: "00000000-0000-0000-0000-000000000001")
public class CClass1 { }
// CHECK-DAG: <COM_DECL_ATTR abbrevid={{[0-9]+}} op0=0 op1=0 op2=2/> blob data = '00000000-0000-0000-0000-000000000001'
@com(implementation: "00000000-0000-0000-0000-000000000002", threading: .free)
public class CClass2 { }
// CHECK-DAG: <COM_DECL_ATTR abbrevid={{[0-9]+}} op0=0 op1=0 op2=3/> blob data = '00000000-0000-0000-0000-000000000002'
@com
public class CClass3 { }
// CHECK-DAG: <COM_DECL_ATTR abbrevid={{[0-9]+}} op0=0 op1=0 op2=2/> blob data = ''