Skip to content

Commit 5a17ec4

Browse files
committed
Add %target-dylib-extension substitution
This is needed for reflection tests to pass on Linux.
1 parent c4d7b1a commit 5a17ec4

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// RUN: rm -rf %t && mkdir -p %t
2-
// RUN: %target-build-swift %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift -parse-as-library -emit-module -emit-library -module-name TypesToReflect -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect
3-
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect > %t/typeref_decoding.txt
2+
// RUN: %target-build-swift %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift -parse-as-library -emit-module -emit-library -module-name TypesToReflect -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect.%target-dylib-extension
3+
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect.%target-dylib-extension > %t/typeref_decoding.txt
44
// RUN: diff -u %S/typeref_decoding.result.txt %t/typeref_decoding.txt
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: rm -rf %t && mkdir -p %t
2-
// RUN: %target-build-swift %S/Inputs/ObjectiveCTypes.swift -parse-as-library -emit-module -emit-library -module-name TypesToReflect -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect
3-
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect > %t/typeref_decoding.txt
2+
// RUN: %target-build-swift %S/Inputs/ObjectiveCTypes.swift -parse-as-library -emit-module -emit-library -module-name TypesToReflect -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect.%target-dylib-extension
3+
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect.%target-dylib-extension > %t/typeref_decoding.txt
44
// RUN: diff -u %S/typeref_decoding_objc.result.txt %t/typeref_decoding.txt
55
// REQUIRES: objc_interop

test/Reflection/typeref_lowering.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t && mkdir -p %t
2-
// RUN: %target-build-swift %S/Inputs/TypeLowering.swift -parse-as-library -emit-module -emit-library -module-name TypeLowering -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect
3-
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect -binary-filename %platform-module-dir/libswiftCore.dylib -dump-type-lowering < %s | FileCheck %s
2+
// RUN: %target-build-swift %S/Inputs/TypeLowering.swift -parse-as-library -emit-module -emit-library -module-name TypeLowering -Xfrontend -enable-reflection-metadata -Xfrontend -enable-reflection-names -o %t/libTypesToReflect.%target-dylib-extension
3+
// RUN: %target-swift-reflection-dump -binary-filename %t/libTypesToReflect.%target-dylib-extension -binary-filename %platform-module-dir/libswiftCore.%target-dylib-extension -dump-type-lowering < %s | FileCheck %s
44

55
// REQUIRES: CPU=x86_64
66

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ if run_vendor == 'apple':
513513
config.target_swiftmodule_name = run_cpu + ".swiftmodule"
514514
config.target_swiftdoc_name = run_cpu + ".swiftdoc"
515515
config.target_object_format = "macho"
516+
config.target_dylib_extension = "dylib"
516517
config.target_runtime = "objc"
517518

518519
xcrun_prefix = (
@@ -691,6 +692,7 @@ elif run_os == 'linux-gnu' or run_os == 'linux-gnueabihf' or run_os == 'freebsd'
691692
else:
692693
lit_config.note("Testing Linux " + config.variant_triple)
693694
config.target_object_format = "elf"
695+
config.target_dylib_extension = "so"
694696
config.target_runtime = "native"
695697
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
696698
config.target_sdk_name = "freebsd" if run_os == "freebsd" else "linux"
@@ -885,6 +887,7 @@ config.substitutions.append(('%target-swiftmodule-name', config.target_swiftmodu
885887
config.substitutions.append(('%target-swiftdoc-name', config.target_swiftdoc_name))
886888

887889
config.substitutions.append(('%target-object-format', config.target_object_format))
890+
config.substitutions.append(('%target-dylib-extension', config.target_dylib_extension))
888891

889892
config.substitutions.append(('%target-resilience-test-wmo', config.target_resilience_test_wmo))
890893
config.substitutions.append(('%target-resilience-test', config.target_resilience_test))

0 commit comments

Comments
 (0)