Skip to content

Commit aa7c96c

Browse files
committed
[TBDGen] Write tbd-v5 files by default
* Fixup tests to handle new json based output. * Use llvm-nm & readtapi to verify tbd file outputs. resolves: rdar://117604275
1 parent 331b11f commit aa7c96c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+251
-186
lines changed

lib/IRGen/TBDGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ TBDFile GenerateTBDRequest::evaluate(Evaluator &evaluator,
593593
auto &ctx = M->getASTContext();
594594

595595
llvm::MachO::InterfaceFile file;
596-
file.setFileType(llvm::MachO::FileType::TBD_V4);
596+
file.setFileType(llvm::MachO::FileType::TBD_V5);
597597
file.setApplicationExtensionSafe(isApplicationExtensionSafe(ctx.LangOpts));
598598
file.setInstallName(opts.InstallName);
599599
file.setTwoLevelNamespace();
@@ -659,7 +659,7 @@ void swift::writeTBDFile(ModuleDecl *M, llvm::raw_ostream &os,
659659
auto desc = TBDGenDescriptor::forModule(M, opts);
660660
auto file = llvm::cantFail(evaluator(GenerateTBDRequest{desc}));
661661
llvm::cantFail(llvm::MachO::TextAPIWriter::writeToStream(os, file),
662-
"YAML writing should be error-free");
662+
"TBD writing should be error-free");
663663
}
664664

665665
class APIGenRecorder final : public APIRecorder {

test/SILOptimizer/default-cmo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: %target-build-swift -O -wmo -Xfrontend -enable-default-cmo -parse-as-library -emit-module -emit-module-path=%t/Submodule.swiftmodule -module-name=Submodule %S/Inputs/cross-module/default-submodule.swift -c -o %t/submodule.o
55
// RUN: %target-build-swift -O -wmo -Xfrontend -enable-default-cmo -parse-as-library -emit-module -emit-module-path=%t/Module.swiftmodule -module-name=Module -I%t -I%S/Inputs/cross-module %S/Inputs/cross-module/default-module.swift -c -o %t/module.o
6-
// RUN: %target-build-swift -O -wmo -Xfrontend -enable-default-cmo -parse-as-library -emit-tbd -emit-tbd-path %t/ModuleTBD.tbd -emit-module -emit-module-path=%t/ModuleTBD.swiftmodule -module-name=ModuleTBD -I%t -I%S/Inputs/cross-module %S/Inputs/cross-module/default-module.swift -c -o %t/moduletbd.o
6+
// RUN: %target-build-swift -O -wmo -Xfrontend -enable-default-cmo -parse-as-library -emit-tbd -emit-tbd-path %t/ModuleTBD.tbd -emit-module -emit-module-path=%t/ModuleTBD.swiftmodule -module-name=ModuleTBD -I%t -I%S/Inputs/cross-module %S/Inputs/cross-module/default-module.swift -c -o %t/moduletbd.o -Xfrontend -tbd-install_name -Xfrontend module
77

88
// RUN: %target-build-swift -O -wmo -module-name=Main -I%t -I%S/Inputs/cross-module %s -emit-sil | %FileCheck %s
99

test/SPI/spi_symbols.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// REQUIRES: VENDOR=apple
22
// RUN: %empty-directory(%t)
33

4-
// RUN: %target-swift-frontend %S/Inputs/spi_helper.swift -emit-ir -o %t/spi_helper.ll -emit-tbd-path %t/spi_helper.tbd -module-name spi_helper
4+
// RUN: %target-swift-frontend %S/Inputs/spi_helper.swift -emit-ir -o %t/spi_helper.ll -emit-tbd-path %t/spi_helper.tbd -module-name spi_helper -tbd-install_name spi_helper
55

66
// RUN: cat %t/spi_helper.ll | %FileCheck -check-prefix=CHECK-IR %s
7-
// RUN: cat %t/spi_helper.tbd | %FileCheck -check-prefix=CHECK-TBD %s
7+
// RUN: %llvm-nm %t/spi_helper.tbd | %FileCheck -check-prefix=CHECK-TBD %s
88

99
// Look for the SPI symbols in the IR
1010
// CHECK-IR: define swiftcc void @"$s10spi_helper0A4FuncyyF"

test/TBD/abi-version.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// 1. Emit IR and a TBD for this file
88

9-
// RUN: %target-swift-frontend -emit-ir -o %t/test.ll %s -emit-tbd-path %t/test.tbd
9+
// RUN: %target-swift-frontend -emit-ir -o %t/test.ll %s -emit-tbd-path %t/test.tbd -tbd-install_name test
1010

1111
// 2. Concatenate them and FileCheck them both in the same file, so we can capture
1212
// the ABI version in a variable.
@@ -19,4 +19,4 @@
1919

2020
// 4. Look in the TBD for the same version listed
2121

22-
// CHECK: swift-abi-version: [[VERSION]]
22+
// CHECK: "abi": [[VERSION]]

test/TBD/all-in-one.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
// RUN: %target-build-swift %S/Inputs/extension_types.swift -module-name ExtensionTypes -emit-module -emit-module-path %t/ExtensionTypes.swiftmodule
99
// RUN: %target-build-swift %S/Inputs/subclass_super.swift -emit-library -emit-module -o %t/subclass_super%{target-shared-library-suffix} -enable-library-evolution
1010

11-
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/incremental_Onone.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module
12-
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/wmo_Onone.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -wmo
11+
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/incremental_Onone.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -Xfrontend -tbd-install_name -Xfrontend all_in_one
12+
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/wmo_Onone.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -wmo -Xfrontend -tbd-install_name -Xfrontend all_in_one
1313

14-
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/incremental_O.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -O
15-
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/wmo_O.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -wmo -O -Xllvm -sil-disable-pass=cmo
14+
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/incremental_O.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -Xfrontend -tbd-install_name -Xfrontend all_in_one -O
15+
// RUN: %target-build-swift -module-name all_in_one -emit-module-path %t/all_in_one.swiftmodule -emit-tbd-path %t/wmo_O.tbd %S/class.swift %t/class_objc.swift %S/enum.swift %t/extension.swift %S/function.swift %S/global.swift %S/main.swift %S/protocol.swift %S/struct.swift %t/subclass.swift -I %t -import-objc-header %S/Inputs/objc_class_header.h -Xfrontend -disable-objc-attr-requires-foundation-module -wmo -O -Xllvm -sil-disable-pass=cmo -Xfrontend -tbd-install_name -Xfrontend all_in_one
1616

17-
// RUN: diff %t/incremental_Onone.tbd %t/wmo_Onone.tbd
18-
// RUN: diff %t/incremental_O.tbd %t/wmo_O.tbd
19-
// RUN: diff %t/incremental_Onone.tbd %t/incremental_O.tbd
17+
// RUN: %llvm-readtapi --compare %t/incremental_Onone.tbd %t/wmo_Onone.tbd
18+
// RUN: %llvm-readtapi --compare %t/incremental_O.tbd %t/wmo_O.tbd
19+
// RUN: %llvm-readtapi --compare %t/incremental_Onone.tbd %t/incremental_O.tbd
2020

2121
// REQUIRES: objc_interop

test/TBD/app-extension.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// REQUIRES: OS=macosx
22
// RUN: %empty-directory(%t)
3-
// RUN: %target-swift-frontend -typecheck %s -application-extension -emit-tbd -emit-tbd-path %t/safe.tbd
4-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/not-safe.tbd
3+
// RUN: %target-swift-frontend -typecheck %s -application-extension -emit-tbd -emit-tbd-path %t/safe.tbd -tbd-install_name app_safe
4+
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/not-safe.tbd -tbd-install_name no_app_safe
55

6-
// RUN: %FileCheck %s --check-prefix EXTENSIONSAFE < %t/safe.tbd
7-
// RUN: %FileCheck %s --check-prefix NOTEXTENSIONSAFE < %t/not-safe.tbd
6+
// RUN: %validate-json %t/safe.tbd | %FileCheck %s --check-prefix EXTENSIONSAFE
7+
// RUN: %validate-json %t/not-safe.tbd | %FileCheck %s --check-prefix NOTEXTENSIONSAFE
88

99
// EXTENSIONSAFE-NOT: not_app_extension_safe
1010
// NOTEXTENSIONSAFE: not_app_extension_safe
1111

12-
// RUN: %target-swift-frontend -target-variant %target-cpu-apple-ios13.1-macabi -typecheck %s -application-extension -emit-tbd -emit-tbd-path %t/target-variant.tbd
13-
// RUN: %FileCheck %s --check-prefix MACABI < %t/target-variant.tbd
14-
15-
// MACABI: targets: [ {{.*}}macos{{.*}}maccatalyst{{.*}} ]
12+
// RUN: %target-swift-frontend -target-variant %target-cpu-apple-ios13.1-macabi -typecheck %s -application-extension -emit-tbd -emit-tbd-path %t/target-variant.tbd -tbd-install_name target-variant
13+
// RUN: %validate-json %t/target-variant.tbd | %FileCheck %s --check-prefix MACABI
1614

15+
// MACABI: "target": "{{.*}}-macos"
16+
// MACABI: "target": "{{.*}}-maccatalyst"

test/TBD/arm64e-arch.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %swift -typecheck -target arm64e-apple-ios12.0 -parse-stdlib -parse-as-library %s -module-name TBDTester -emit-tbd -emit-tbd-path - | %FileCheck %s
1+
// RUN: %swift -typecheck -target arm64e-apple-ios12.0 -parse-stdlib -parse-as-library %s -module-name TBDTester -emit-tbd -emit-tbd-path %t/arm64e.tbd -tbd-install_name arm64e
2+
// RUN: %llvm-nm -arch arm64e %t/arm64e.tbd | %FileCheck %s
23

34
public func testSwiftFunc() {}
45

5-
// CHECK: --- !tapi-tbd
6-
// CHECK: arm64e
7-
// CHECK: symbols: [ '_$s{{.*}}testSwiftFunc{{.*}}' ]
6+
7+
// CHECK: _$s{{.*}}testSwiftFunc{{.*}}

test/TBD/class.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing -O
1111

1212
// RUN: %empty-directory(%t)
13-
// RUN: %target-swift-frontend -typecheck -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/typecheck.tbd
14-
// RUN: %target-swift-frontend -emit-ir -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/emit-ir.tbd
15-
// RUN: diff -u %t/typecheck.tbd %t/emit-ir.tbd
13+
// RUN: %target-swift-frontend -typecheck -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/typecheck.tbd -tbd-install_name class
14+
// RUN: %target-swift-frontend -emit-ir -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/emit-ir.tbd -tbd-install_name class
15+
// RUN: %llvm-readtapi --compare %t/typecheck.tbd %t/emit-ir.tbd
1616

1717
open class OpenNothing {}
1818

test/TBD/custom_objc_error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: VENDOR=apple
22
// RUN: %empty-directory(%t)
33

4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -I %S/Inputs/ -disable-objc-attr-requires-foundation-module -emit-tbd -emit-tbd-path %t/test.tbd
4+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -I %S/Inputs/ -disable-objc-attr-requires-foundation-module -emit-tbd -emit-tbd-path %t/test.tbd -tbd-install_name objc_err
55

66
import Foundation
77
@_exported import CustomError

test/TBD/distributed.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// REQUIRES: distributed
44

55
// RUN: %empty-directory(%t)
6-
// RUN: %target-swift-frontend %s -enable-testing -disable-availability-checking -emit-ir -o %t/test.ll -emit-tbd -emit-tbd-path %t/test.tbd -I %t
7-
// RUN cat %t/test.tbd | %FileCheck %s --dump-input=always
6+
// RUN: %target-swift-frontend %s -enable-testing -disable-availability-checking -emit-ir -o %t/test.ll -emit-tbd -emit-tbd-path %t/test.tbd -I %t -tbd-install_name distributed
7+
// RUN %llvm-nm -g %t/test.tbd | %FileCheck %s --dump-input=always
88

99
import Distributed
1010

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
// REQUIRES: VENDOR=apple
22
// RUN: %empty-directory(%t)
33

4-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-current-version 2.0 | %FileCheck %s --check-prefix TWOPOINTZERO
5-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-current-version 2 | %FileCheck %s --check-prefix TWOPOINTZERO
6-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-current-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTEN
4+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 2.0 | %FileCheck %s --check-prefix TWOPOINTZERO
5+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 2 | %FileCheck %s --check-prefix TWOPOINTZERO
6+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTEN
77

8-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-compatibility-version 2.0 | %FileCheck %s --check-prefix TWOPOINTZEROCOMPAT
9-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-compatibility-version 2 | %FileCheck %s --check-prefix TWOPOINTZEROCOMPAT
10-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-compatibility-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTENCOMPAT
8+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-compatibility-version 2.0 | %FileCheck %s --check-prefix TWOPOINTZEROCOMPAT
9+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-compatibility-version 2 | %FileCheck %s --check-prefix TWOPOINTZEROCOMPAT
10+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-compatibility-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTENCOMPAT
1111

1212
// Make sure we correctly truncate a value over 255
1313

14-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-current-version 20.300 2>&1 | %FileCheck %s --check-prefix TWENTYPOINTTHREEHUNDRED
15-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-compatibility-version 20.300 2>&1 | %FileCheck %s --check-prefix TWENTYPOINTTHREEHUNDREDCOMPAT
14+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 20.300 2>&1 | %FileCheck %s --check-prefix TWENTYPOINTTHREEHUNDRED
15+
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-compatibility-version 20.300 2>&1 | %FileCheck %s --check-prefix TWENTYPOINTTHREEHUNDREDCOMPAT
1616

17-
// TWOPOINTZERO: current-version: 2
18-
// TWENTYPOINTTEN: current-version: 20.10
17+
// TWOPOINTZERO: current_versions
18+
// TWOPOINTZERO: "version": "2"
1919

20-
// TWOPOINTZEROCOMPAT: compatibility-version: 2
21-
// TWENTYPOINTTENCOMPAT: compatibility-version: 20.10
20+
// TWENTYPOINTTEN: current_versions
21+
// TWENTYPOINTTEN: "version": "20.10"
22+
23+
// TWOPOINTZEROCOMPAT: compatibility_versions
24+
// TWOPOINTZEROCOMPAT: "version": "2"
25+
26+
// TWENTYPOINTTENCOMPAT: compatibility_versions
27+
// TWENTYPOINTTENCOMPAT: "version": "20.10"
2228

2329
// TWENTYPOINTTHREEHUNDRED: warning: truncating current version '20.300' in TBD file to fit in 32-bit space used by old mach-o format
24-
// TWENTYPOINTTHREEHUNDRED: current-version: 20.255
30+
// TWENTYPOINTTHREEHUNDRED: current_versions
31+
// TWENTYPOINTTHREEHUNDRED: "version": "20.255"
2532

2633
// TWENTYPOINTTHREEHUNDREDCOMPAT: warning: truncating compatibility version '20.300' in TBD file to fit in 32-bit space used by old mach-o format
27-
// TWENTYPOINTTHREEHUNDREDCOMPAT: compatibility-version: 20.255
34+
// TWENTYPOINTTHREEHUNDREDCOMPAT: compatibility_versions
35+
// TWENTYPOINTTHREEHUNDREDCOMPAT: "version": "20.255"

test/TBD/dylib-version.swift

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
// REQUIRES: VENDOR=apple
22
// RUN: %empty-directory(%t)
3-
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-current-version 2.0.3 -tbd-compatibility-version 1.7 -emit-tbd -emit-tbd-path %t/both_provided.tbd
4-
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-current-version 2.0 -emit-tbd -emit-tbd-path %t/only_current_provided.tbd
5-
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-compatibility-version 2 -emit-tbd -emit-tbd-path %t/only_compat_provided.tbd
6-
// RUN: not %target-swift-frontend -emit-ir -o /dev/null %s -tbd-compatibility-version not_a_version_string -emit-tbd -emit-tbd-path /dev/null 2>&1 | %FileCheck %s --check-prefix BOGUS
3+
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-install_name some_dylib -tbd-current-version 2.0.3 -tbd-compatibility-version 1.7 -emit-tbd -emit-tbd-path %t/both_provided.tbd
4+
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-install_name some_dylib -tbd-current-version 2.0 -emit-tbd -emit-tbd-path %t/only_current_provided.tbd
5+
// RUN: %target-swift-frontend -emit-ir -o /dev/null %s -tbd-install_name some_dylib -tbd-compatibility-version 2 -emit-tbd -emit-tbd-path %t/only_compat_provided.tbd
6+
// RUN: not %target-swift-frontend -emit-ir -o /dev/null %s -tbd-install_name some_dylib -tbd-compatibility-version not_a_version_string -emit-tbd -emit-tbd-path /dev/null 2>&1 | %FileCheck %s --check-prefix BOGUS
77

8-
// RUN: %FileCheck %s --check-prefix BOTH < %t/both_provided.tbd
9-
// RUN: %FileCheck %s --check-prefix CURRENT < %t/only_current_provided.tbd
10-
// RUN: %FileCheck %s --check-prefix COMPAT < %t/only_compat_provided.tbd
8+
// RUN: %validate-json %t/both_provided.tbd | %FileCheck %s --check-prefix BOTH
9+
// RUN: %validate-json %t/only_current_provided.tbd | %FileCheck %s --check-prefix CURRENT
10+
// RUN: %validate-json %t/only_compat_provided.tbd | %FileCheck %s --check-prefix COMPAT
1111

12-
// BOTH: current-version: 2.0.3
13-
// BOTH: compatibility-version: 1.7
14-
// CURRENT: current-version: 2
15-
// COMPAT: compatibility-version: 2
12+
// BOTH: compatibility_versions
13+
// BOTH: "version": "1.7"
14+
// BOTH: current_versions
15+
// BOTH: "version": "2.0.3"
16+
17+
// CURRENT: current_versions
18+
// CURRENT: "version": "2"
19+
20+
// COMPAT: compatibility_versions
21+
// COMPAT: "version": "2"
1622

1723
// BOGUS: invalid dynamic library compatibility version 'not_a_version_string'

test/TBD/embed-symbol.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// RUN: echo 'public class Bar {}' > %t/bar.swift
66
// RUN: %target-swift-frontend -emit-module %t/foo.swift -emit-module-path %t/foo.swiftmodule
77
// RUN: %target-swift-frontend -emit-module %t/bar.swift -emit-module-path %t/bar.swiftmodule
8-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/flag-not-provided.tbd -I %t -module-name main
9-
// RUN: %FileCheck %s --check-prefix FLAG-NOT-PROVIDED < %t/flag-not-provided.tbd
8+
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/flag-not-provided.tbd -I %t -module-name main -tbd-install_name main
9+
// RUN: %llvm-nm %t/flag-not-provided.tbd | %FileCheck %s --check-prefix FLAG-NOT-PROVIDED
1010

11-
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/flag-provided.tbd -I %t -embed-tbd-for-module foo -embed-tbd-for-module bar -module-name main
12-
// RUN: %FileCheck %s --check-prefix FLAG-PROVIDED < %t/flag-provided.tbd
11+
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/flag-provided.tbd -I %t -embed-tbd-for-module foo -embed-tbd-for-module bar -module-name main -tbd-install_name main
12+
// RUN: %llvm-nm %t/flag-provided.tbd | %FileCheck %s --check-prefix FLAG-PROVIDED
1313

1414
import foo
1515
import bar

test/TBD/emit-tbd-from-driver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// RUN: echo "public func foo() -> some CustomStringConvertible { 32 }" > %t/source1.swift
88
// RUN: echo "" > %t/source2.swift
99

10-
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -module-name multifile %t/source1.swift %t/source2.swift -Xfrontend -validate-tbd-against-ir=all -emit-tbd -emit-tbd-path %t/multifile.tbd -enable-library-evolution -emit-module
10+
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -module-name multifile %t/source1.swift %t/source2.swift -Xfrontend -validate-tbd-against-ir=all -emit-tbd -emit-tbd-path %t/multifile.tbd -Xfrontend -tbd-install_name -Xfrontend multifile -enable-library-evolution -emit-module
1111

12-
// RUN: %FileCheck %s < %t/multifile.tbd
12+
// RUN: %validate-json %t/multifile.tbd | %FileCheck %s
1313

1414
// CHECK: s9multifile3fooQryFQOMQ

0 commit comments

Comments
 (0)