mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Protocol requirements may not necessarily add new entries to the witness table if it's inherited from super protocol. This patch teaches the json dump to include a flag indicating whether a protocol requirement requires new witness table entry and diagnoses the change of such flag as ABI breakages. rdar://47657204
12 lines
1.2 KiB
Swift
12 lines
1.2 KiB
Swift
// RUN: %empty-directory(%t.mod1)
|
|
// RUN: %empty-directory(%t.mod2)
|
|
// RUN: %empty-directory(%t.sdk)
|
|
// RUN: %empty-directory(%t.module-cache)
|
|
// RUN: %swift -emit-module -o %t.mod1/cake.swiftmodule %S/Inputs/cake1.swift -parse-as-library -enable-library-evolution -I %S/Inputs/APINotesLeft %clang-importer-sdk-nosource
|
|
// RUN: %swift -emit-module -o %t.mod2/cake.swiftmodule %S/Inputs/cake2.swift -parse-as-library -enable-library-evolution -I %S/Inputs/APINotesRight %clang-importer-sdk-nosource
|
|
// RUN: %api-digester -dump-sdk -module cake -o - -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod1 -I %S/Inputs/APINotesLeft -abi | sed 's/"cake"/"cake1"/' > %t.dump1.json
|
|
// RUN: %api-digester -dump-sdk -module cake -o - -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod2 -I %S/Inputs/APINotesLeft -abi | sed 's/"cake"/"cake2"/' > %t.dump2.json
|
|
// RUN: %api-digester -diagnose-sdk -print-module --input-paths %t.dump1.json -input-paths %t.dump2.json -abi -o %t.result
|
|
// RUN: %clang -E -P -x c %S/Outputs/Cake-abi.txt -o - | sed '/^\s*$/d' > %t.abi.expected
|
|
// RUN: %clang -E -P -x c %t.result -o - | sed '/^\s*$/d' > %t.abi.result.tmp
|
|
// RUN: diff -u %t.abi.expected %t.abi.result.tmp |