// RUN: %empty-directory(%t) // RUN: %target-build-swift-dylib(%t/%target-library-name(Basic)) %S/../Inputs/conditional_conformance_basic_conformances.swift -module-name Basic -emit-module -emit-module-path %t/Basic.swiftmodule // RUN: %target-build-swift-dylib(%t/%target-library-name(WithAssoc)) %S/../Inputs/conditional_conformance_with_assoc.swift -module-name WithAssoc -emit-module -emit-module-path %t/WithAssoc.swiftmodule // RUN: %target-build-swift-dylib(%t/%target-library-name(Subclass)) %S/../Inputs/conditional_conformance_subclass.swift -module-name Subclass -emit-module -emit-module-path %t/Subclass.swiftmodule // RUN: %target-build-swift -I%t -L%t -lBasic -lWithAssoc -lSubclass %s -o %t/conditional_conformances_modules %target-rpath(%t) // RUN: %target-codesign %t/conditional_conformances_modules // RUN: %target-run %t/conditional_conformances_modules %t/%target-library-name(Basic) %t/%target-library-name(WithAssoc) %t/%target-library-name(Subclass) // REQUIRES: executable_test // FIXME: seems to fail on 32-bit simulator? // REQUIRES: OS=macosx || OS=linux-gnu || OS=linux-androideabi || OS=linux-android import Basic import WithAssoc import Subclass public func basic_single_generic(_: T.Type) { Basic.takes_p1(Basic.Single.self) } public func basic_single_concrete() { Basic.takes_p1(Basic.Single.self) } public func basic_double_generic_generic(_: U.Type, _: V.Type) { Basic.takes_p1(Basic.Double.self) } public func basic_double_generic_concrete(_: X.Type) { Basic.takes_p1(Basic.Double.self) } public func basic_double_concrete_concrete() { Basic.takes_p1(Basic.Double.self) } public func with_assoc_generic_generic(_: T.Type, _: U.Type) where T.AT2: WithAssoc.P2, U: WithAssoc.P3, T.AT2.AT2.AT3: WithAssoc.P3 { WithAssoc.takes_p1(WithAssoc.Double.self) } public func with_assoc_generic_concrete(_: T.Type) where T.AT2: WithAssoc.P2, T.AT2.AT2.AT3: WithAssoc.P3 { WithAssoc.takes_p1(WithAssoc.Double.self) } public func with_assoc_concrete_generic(_: U.Type) where U: WithAssoc.P3 { WithAssoc.takes_p1(WithAssoc.Double.self) } public func with_assoc_concrete_concrete() { WithAssoc.takes_p1(WithAssoc.Double.self) } public func subclass_subclassgeneric_generic(_: T.Type) { Subclass.takes_p1(Subclass.SubclassGeneric.self) } public func subclass_subclassgeneric_concrete() { Subclass.takes_p1(Subclass.SubclassGeneric.self) } public func subclass_subclassconcrete() { Subclass.takes_p1(Subclass.SubclassConcrete.self) } public func subclass_subclassgenericconcrete() { Subclass.takes_p1(Subclass.SubclassGenericConcrete.self) } basic_single_generic(Basic.IsP2.self) basic_single_concrete() basic_double_generic_generic(Basic.IsP2.self, Basic.IsP3.self) basic_double_generic_concrete(Basic.IsP2.self) basic_double_concrete_concrete() with_assoc_generic_generic(WithAssoc.IsAlsoP2.self, WithAssoc.IsP3.self) with_assoc_generic_concrete(WithAssoc.IsAlsoP2.self) with_assoc_concrete_generic(WithAssoc.IsP3.self) with_assoc_concrete_concrete() subclass_subclassgeneric_generic(Subclass.IsP2.self) subclass_subclassgeneric_concrete() subclass_subclassconcrete() subclass_subclassgenericconcrete()