Skip to content

Commit afd0b69

Browse files
committed
test: get most of the multifile tests working on Windows
We cannot link against the DSO (dll) on Windows and instead link against the import library. Let the driver understand this and use the standard linking technique. Adjust the name of the emitted files accordingly and use the `%target-library-name` macro more freely. Two tests remain: - multifile.protocol-conformance-member The getter is synthesized by not exported so `llvm-nm` is unable to see it - multifile.nested_types Windows uses the singleton strategy, so the emitted full type metadata does not have the reference to the value witness table for Void
1 parent 8e38b67 commit afd0b69

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

test/multifile/default-arguments/two-modules/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: mkdir -p %t/onone %t/wmo
4-
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library1.swift %S/Inputs/library2.swift -o %t/onone/library%{target-shared-library-suffix} -swift-version 4
5-
// RUN: %target-build-swift %S/main.swift %t/onone/library%{target-shared-library-suffix} -I %t/onone/ -o %t/onone/main -swift-version 4
4+
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library1.swift %S/Inputs/library2.swift -o %t/onone/%target-library-name(rary) -swift-version 4
5+
// RUN: %target-build-swift %S/main.swift -I %t/onone/ -o %t/onone/main -swift-version 4 -L%t/onone -lrary
66

7-
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library1.swift %S/Inputs/library2.swift -o %t/wmo/library%{target-shared-library-suffix} -swift-version 4
8-
// RUN: %target-build-swift %S/main.swift %t/wmo/library%{target-shared-library-suffix} -I %t/wmo/ -o %t/wmo/main -swift-version 4
7+
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library1.swift %S/Inputs/library2.swift -o %t/wmo/%target-library-name(rary) -swift-version 4
8+
// RUN: %target-build-swift %S/main.swift -I %t/wmo/ -o %t/wmo/main -swift-version 4 -L%t/wmo -lrary
99

1010
import library
1111

test/multifile/extensions/two-modules/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: mkdir -p %t/onone %t/wmo
4-
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/library%{target-shared-library-suffix}
5-
// RUN: %target-build-swift %S/main.swift %t/onone/library%{target-shared-library-suffix} -I %t/onone/ -o %t/onone/main
4+
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/%target-library-name(rary)
5+
// RUN: %target-build-swift %S/main.swift -I %t/onone/ -o %t/onone/main -L%t/onone -lrary
66

7-
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/library%{target-shared-library-suffix}
8-
// RUN: %target-build-swift %S/main.swift %t/wmo/library%{target-shared-library-suffix} -I %t/wmo/ -o %t/wmo/main
7+
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/%target-library-name(rary)
8+
// RUN: %target-build-swift %S/main.swift -I %t/wmo/ -o %t/wmo/main -L%t/wmo -lrary
99

1010
import library
1111

test/multifile/multiconformanceimpls/main.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift-dylib(%t/%{target-shared-library-prefix}A%{target-shared-library-suffix}) %S/Inputs/A.swift -emit-module -emit-module-path %t/A.swiftmodule -module-name A
2+
//
3+
// RUN: %target-build-swift-dylib(%t/%target-library-name(A)) %S/Inputs/A.swift -emit-module -emit-module-path %t/A.swiftmodule -module-name A
34
// RUN: %target-codesign %t/%target-library-name(A)
4-
// RUN: %target-build-swift-dylib(%t/%{target-shared-library-prefix}B%{target-shared-library-suffix}) %S/Inputs/B.swift -emit-module -emit-module-path %t/B.swiftmodule -module-name B -I%t -L%t -lA
5+
//
6+
// RUN: %target-build-swift-dylib(%t/%target-library-name(B)) %S/Inputs/B.swift -emit-module -emit-module-path %t/B.swiftmodule -module-name B -I%t -L%t -lA
57
// RUN: %target-codesign %t/%target-library-name(B)
6-
// RUN: %target-build-swift-dylib(%t/%{target-shared-library-prefix}C%{target-shared-library-suffix}) %S/Inputs/C.swift -emit-module -emit-module-path %t/C.swiftmodule -module-name C -I%t -L%t -lA
8+
//
9+
// RUN: %target-build-swift-dylib(%t/%target-library-name(C)) %S/Inputs/C.swift -emit-module -emit-module-path %t/C.swiftmodule -module-name C -I%t -L%t -lA
710
// RUN: %target-codesign %t/%target-library-name(C)
8-
// RUN: %target-build-swift %s -I %t -o %t/a.out -L %t %target-rpath(%t) -lA -lB -lC
9-
// RUN: %target-codesign %t/a.out
10-
// RUN: %target-run %t/a.out %t/%target-library-name(A) %t/%target-library-name(B) %t/%target-library-name(C) | %FileCheck %s
11+
//
12+
// RUN: %target-build-swift %s -I %t -o %t/main.out -L %t %target-rpath(%t) -lA -lB -lC
13+
// RUN: %target-codesign %t/main.out
14+
//
15+
// RUN: %target-run %t/main.out %t/%target-library-name(A) %t/%target-library-name(B) %t/%target-library-name(C) | %FileCheck %s
1116

1217
// REQUIRES: executable_test
1318

test/multifile/protocol-conformance-member.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -emit-library %s %S/Inputs/protocol-conformance-member-helper.swift -o %t/libTest.dylib -module-name Test
3-
// RUN: llvm-nm %t/libTest.dylib | %FileCheck %s
2+
// RUN: %target-build-swift -emit-library %s %S/Inputs/protocol-conformance-member-helper.swift -o %t/%target-library-name(Test) -module-name Test
3+
// RUN: llvm-nm %t/%target-library-name(Test) | %FileCheck %s
44

55
// CHECK: $s4Test10CoolStructV10coolFactorSdvg
66

test/multifile/synthesized-accessors/two-modules/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: mkdir -p %t/onone %t/wmo
4-
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/library%{target-shared-library-suffix}
5-
// RUN: %target-build-swift %S/main.swift %t/onone/library%{target-shared-library-suffix} -I %t/onone/ -o %t/onone/main
4+
// RUN: %target-build-swift -emit-module -emit-module-path %t/onone/library.swiftmodule -module-name=library -emit-library %S/Inputs/library.swift -o %t/onone/%target-library-name(rary)
5+
// RUN: %target-build-swift %S/main.swift -I %t/onone/ -o %t/onone/main -L%t/onone -lrary
66

7-
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/library%{target-shared-library-suffix}
8-
// RUN: %target-build-swift %S/main.swift %t/wmo/library%{target-shared-library-suffix} -I %t/wmo/ -o %t/wmo/main
7+
// RUN: %target-build-swift -emit-module -emit-module-path %t/wmo/library.swiftmodule -module-name=library -emit-library -O -wmo %S/Inputs/library.swift -o %t/wmo/%target-library-name(rary)
8+
// RUN: %target-build-swift %S/main.swift -I %t/wmo/ -o %t/wmo/main -L%t/wmo -lrary
99

1010
import library
1111

0 commit comments

Comments
 (0)