diff --git a/lib/Frontend/Frontend.cpp b/lib/Frontend/Frontend.cpp index 8432f30809a..7ce2ee7783c 100644 --- a/lib/Frontend/Frontend.cpp +++ b/lib/Frontend/Frontend.cpp @@ -238,6 +238,9 @@ SerializationOptions CompilerInvocation::computeSerializationOptions( serializationOpts.ExtraClangOptions.push_back("--target=" + LangOpts.ClangTarget->str()); } + if (LangOpts.EnableAppExtensionRestrictions) { + serializationOpts.ExtraClangOptions.push_back("-fapplication-extension"); + } serializationOpts.PluginSearchOptions = getSearchPathOptions().PluginSearchOpts; diff --git a/test/Serialization/application-extension.swift b/test/Serialization/application-extension.swift new file mode 100644 index 00000000000..15d4ac3021b --- /dev/null +++ b/test/Serialization/application-extension.swift @@ -0,0 +1,10 @@ +// RUN: %empty-directory(%t) +// RUN: %target-swift-frontend -emit-module -module-name AppExtSafe -emit-module-path %t/AppExtSafe.swiftmodule -parse-as-library -serialize-debugging-options -application-extension %s + +// Check the serialized flags paths. +// RUN: llvm-bcanalyzer -dump %t/AppExtSafe.swiftmodule > %t/AppExtSafe.swiftmodule.txt +// RUN: %FileCheck %s < %t/AppExtSafe.swiftmodule.txt + +// CHECK-LABEL: blob data = '-fapplication-extension' +// CHECK: