1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-build-swift -Xfrontend -disable-availability-checking -I %swift-lib-dir -I %swift_src_root/lib/ExternalGenericMetadataBuilder -enable-experimental-feature Extern %s -o %t/VerifyExternalMetadata
2
+ //
3
+ // RUN: %host-build-swift %S/Inputs/testMetadataLibrary.swift -emit-library -emit-module -o %t/libtestMetadataLibrary.dylib
4
+ // RUN: %target-codesign %t/libtestMetadataLibrary.dylib
5
+ //
6
+ // RUN: %target-build-swift -Xfrontend -disable-availability-checking -I %swift-lib-dir -I %swift_src_root/lib/ExternalGenericMetadataBuilder -I %t -L %t -ltestMetadataLibrary -enable-experimental-feature Extern %s -o %t/VerifyExternalMetadata
3
7
// RUN: %target-codesign %t/VerifyExternalMetadata
4
8
//
5
9
// RUN: %host-build-swift -Xfrontend -disable-availability-checking -I %swift-lib-dir -I %swift_src_root/lib/ExternalGenericMetadataBuilder -L%swift-lib-dir -lswiftGenericMetadataBuilder -Xlinker -rpath -Xlinker %swift-lib-dir -enable-experimental-feature Extern %S/Inputs/buildMetadataJSON.swift -o %t/buildMetadataJSON
11
15
// RUN: %target-run %t/VerifyExternalMetadata getJSON > %t/names.json
12
16
// RUN: %target-run %t/buildMetadataJSON %target-arch %t/VerifyExternalMetadata %stdlib_dir/libswiftCore.dylib < %t/names.json > %t/libswiftPrespecialized.json
13
17
// RUN: %target-run %t/json2c %t/libswiftPrespecialized.json > %t/libswiftPrespecialized.c
14
- // RUN: %clang -isysroot %sdk -target %target-triple -bundle %t/libswiftPrespecialized.c -L%stdlib_dir -lswiftCore -bundle_loader %t/VerifyExternalMetadata - o %t/libswiftPrespecialized.bundle
18
+ // RUN: %clang -isysroot %sdk -target %target-triple -dynamiclib %t/libswiftPrespecialized.c -L%stdlib_dir -lswiftCore -o %t/libswiftPrespecialized.dylib
15
19
//
16
20
// Set a custom library path because we need to ensure we don't load an arm64e
17
21
// dylib into an arm64 test, since the prespecialized metadata depends on the
18
22
// exact contents of the library.
19
- // RUN: env SWIFT_DEBUG_ENABLE_LIB_PRESPECIALIZED_LOGGING=y SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH=%t/libswiftPrespecialized.bundle %target-run env DYLD_LIBRARY_PATH=%stdlib_dir/%target-arch %t/VerifyExternalMetadata
23
+ // RUN: env SWIFT_DEBUG_ENABLE_LIB_PRESPECIALIZED_LOGGING=y DYLD_INSERT_LIBRARIES=%t/libswiftPrespecialized.dylib SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH=%t/libswiftPrespecialized.dylib %target-run env DYLD_LIBRARY_PATH=%stdlib_dir/%target-arch %t/VerifyExternalMetadata
20
24
21
25
// REQUIRES: executable_test
22
26
// REQUIRES: OS=macosx && CPU=arm64
@@ -25,32 +29,7 @@ import ExternalGenericMetadataBuilder
25
29
import Foundation
26
30
import StdlibUnittest
27
31
28
- public struct GenericStruct < T, U, V> {
29
- var t : T
30
- var u : U
31
- var v : V
32
- var str : String
33
- }
34
-
35
- public struct GenericField < T, U> {
36
- var field : GenericStruct < T , U , Double >
37
- var int : Int
38
- }
39
-
40
- public struct Box < T> {
41
- var field : T
42
- }
43
-
44
- public struct Box3 < T, U, V> {
45
- var field1 : T
46
- var field2 : U
47
- var field3 : V
48
- }
49
-
50
- // The protocol conformance puts a symbol into __DATA_CONST which the builder
51
- // can use as the base symbol for references to other data.
52
- public protocol PublicProto { }
53
- extension Box3 : PublicProto { }
32
+ import testMetadataLibrary
54
33
55
34
let args = CommandLine . arguments
56
35
@@ -60,8 +39,8 @@ if args.count > 1 && args[1] == "getJSON" {
60
39
GenericField < GenericField < Int8 , Int16 > ,
61
40
Array < GenericStruct < Double , String , Float > > > . self,
62
41
Array< Array< Array< Array< Array< Array< Array< Double>>>>>>> . self ,
63
- Box< Int> . self ,
64
- Box< String> . self ,
42
+ testMetadataLibrary . Box< Int> . self ,
43
+ testMetadataLibrary . Box< String> . self ,
65
44
Box3< Int, Int, Int> . self ,
66
45
]
67
46
let typeNames = types. map { _mangledTypeName ( $0) ! }
0 commit comments