diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index d1e6dddd05833..68af5647ade66 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -6094,6 +6094,14 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() { break; } + case decls_block::Section_DECL_ATTR: { + bool isImplicit; + serialization::decls_block::SectionDeclAttrLayout::readRecord( + scratch, isImplicit); + Attr = new (ctx) SectionAttr(blobData, isImplicit); + break; + } + case decls_block::RawLayout_DECL_ATTR: { bool isImplicit; TypeID typeID; diff --git a/test/Serialization/attr-section.swift b/test/Serialization/attr-section.swift new file mode 100644 index 0000000000000..5dd0e5d58e29f --- /dev/null +++ b/test/Serialization/attr-section.swift @@ -0,0 +1,12 @@ +// REQUIRES: swift_in_compiler + +// RUN: %empty-directory(%t) +// RUN: %target-swift-frontend -parse-as-library -enable-experimental-feature SymbolLinkageMarkers -emit-module-path %t/a.swiftmodule -module-name a %s +// RUN: llvm-bcanalyzer -dump %t/a.swiftmodule | %FileCheck --check-prefix BC-CHECK --implicit-check-not UnknownCode %s +// RUN: %target-swift-ide-test -print-module -module-to-print a -source-filename x -I %t | %FileCheck --check-prefix MODULE-CHECK %s + +// BC-CHECK: