Files
swift-mirror/test/Runtime/synthesized_decl_uniqueness.swift
Doug Gregor 32f577abf2 [Runtime] Perform “deep” comparisons of witness tables when uniquing metadata.
Metadata uniquing might encounter witness tables that were distinctly
generated but come from identical descriptors. Handle this case in metadata
uniquing be looking into the protocol conformance descriptors themselves.
2018-11-20 22:07:55 -08:00

24 lines
957 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -parse-as-library -force-single-frontend-invocation %S/Inputs/synthesized_decl_uniqueness.swift -emit-object -o %t/A.o -module-name A -emit-module-path %t/A.swiftmodule
// RUN: %target-build-swift -parse-as-library -force-single-frontend-invocation %S/Inputs/synthesized_decl_uniqueness.swift -emit-object -o %t/B.o -module-name B -emit-module-path %t/B.swiftmodule
// RUN: %target-build-swift -I %t %s %t/A.o %t/B.o -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %target-run %t/a.out
// REQUIRES: executable_test
// REQUIRES: objc_interop
import StdlibUnittest
import A
import B
var tests = TestSuite("metadata identity for synthesized types")
tests.test("synthesized type identity across modules") {
expectEqual(A.getCLError(), B.getCLError())
expectEqual(A.getCLErrorCode(), B.getCLErrorCode())
expectEqual(A.getNotificationNameSet(), B.getNotificationNameSet())
}
runAllTests()