Merge pull request #67369 from compnerd/static-serialization

Serialization: allow `IS_STATIC_LIBRARY` to be deserialised properly
This commit is contained in:
Saleem Abdulrasool
2023-07-19 07:14:48 -07:00
committed by GitHub
2 changed files with 13 additions and 0 deletions

View File

@@ -837,6 +837,7 @@ void Serializer::writeBlockInfoBlock() {
BLOCK_RECORD(options_block, SDK_PATH);
BLOCK_RECORD(options_block, XCC);
BLOCK_RECORD(options_block, IS_SIB);
BLOCK_RECORD(options_block, IS_STATIC_LIBRARY);
BLOCK_RECORD(options_block, IS_TESTABLE);
BLOCK_RECORD(options_block, ARE_PRIVATE_IMPORTS_ENABLED);
BLOCK_RECORD(options_block, RESILIENCE_STRATEGY);

View File

@@ -0,0 +1,12 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t %s
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix DYNAMIC
// RUN: %target-swift-frontend -static -emit-module -o %t %s
// RUN: llvm-bcanalyzer -dump %t/static.swiftmodule | %FileCheck %s -check-prefix CHECK -check-prefix STATIC
// CHECK: <MODULE_BLOCK {{.*}}>
// CHECK-STATIC: <IS_STATIC abbrevid={{[0-9]+}}/>
// CHECK-DYNAMIC-NOT: <IS_STATIC abbrevid={{[0-9]+}}/>
// CHECK: </MODULE_BLOCK>