<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 3e8e190eecc3..54745d017b6f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -292,12 +292,14 @@ bool AsmPrinter::doInitialization(Module &amp;M) {
   // alternative is duplicated code in each of the target asm printers that
   // use the directive, where it would need the same conditionalization
   // anyway.
-  const Triple &amp;Target = TM.getTargetTriple();
-  Triple TVT(M.getDarwinTargetVariantTriple());
-  OutStreamer-&gt;emitVersionForTarget(
+  if (MAI-&gt;useIntegratedAssembler()) {
+    const Triple &amp;Target = TM.getTargetTriple();
+    Triple TVT(M.getDarwinTargetVariantTriple());
+    OutStreamer-&gt;emitVersionForTarget(
       Target, M.getSDKVersion(),
       M.getDarwinTargetVariantTriple().empty() ? nullptr : &amp;TVT,
       M.getDarwinTargetVariantSDKVersion());
+  }
 
   // Allow the target to emit any magic that it wants at the start of the file.
   emitStartOfAsmFile(M);
</pre></body></html>