Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -186,7 +186,7 @@ // use the directive, where it would need the same conditionalization // anyway. Triple TT(getTargetTriple()); - if (TT.isOSDarwin()) { + if (TT.isOSDarwin() && MAI->useIntegratedAssembler()) { unsigned Major, Minor, Update; TT.getOSVersion(Major, Minor, Update); // If there is a version specified, Major will be non-zero. Index: test/MC/MachO/no-integrated-as.ll =================================================================== --- /dev/null +++ test/MC/MachO/no-integrated-as.ll @@ -0,0 +1,9 @@ +; RUN: llc -mtriple=x86_64-apple-darwin10.9 -no-integrated-as -o - %s > %t +; RUN: FileCheck --check-prefix=CHECK-ASM < %t %s + +; CHECK-ASM-NOT: .macosx_version_min + +; RUN: llc -mtriple=x86_64-apple-darwin10.9 -no-integrated-as -filetype=obj -o - %s | macho-dump > %t +; RUN: FileCheck --check-prefix=CHECK-OBJ < %t %s + +; CHECK-OBJ-NOT: (('command', 36)