Files
swift-mirror/test/ModuleInterface/alwaysEmitConformanceMetadata_attr.swift
Artem Chikin 4e2c1d16f6 Add '@_alwaysEmitConformanceMetadata' protocol attribute
This attribute will, in the near future, be used to inform IRGen that a nominal type that conforms to such protocol must have its type metadata always emitted into the binary, regardless of whether it is used/public.
2022-08-04 14:19:33 -07:00

19 lines
722 B
Swift

// RUN: %empty-directory(%t)
// Ensure the attribute is printed in swiftinterface files
// RUN: %target-swift-emit-module-interface(%t/Foo.swiftinterface) %s -module-name Foo
// RUN: %target-swift-typecheck-module-from-interface(%t/Foo.swiftinterface) -module-name Foo
// RUN: %FileCheck %s < %t/Foo.swiftinterface
// Ensure the attribute is in .swiftmodule files
// RUN: %target-swift-ide-test -print-module -module-to-print Foo -I %t -source-filename %s -fully-qualified-types -print-access > %t/printed-module.txt
// RUN: %FileCheck %s < %t/printed-module.txt
@_alwaysEmitConformanceMetadata
public protocol TestP {
static var foo: Int { get }
}
// CHECK: @_alwaysEmitConformanceMetadata public protocol TestP