diff --git a/llvm/test/Object/nm-darwin-m.test b/llvm/test/Object/nm-darwin-m.test index 6c718128aa61..5bb19dcacd37 100644 --- a/llvm/test/Object/nm-darwin-m.test +++ b/llvm/test/Object/nm-darwin-m.test @@ -2,7 +2,7 @@ RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test1.mach0-armv7 \ RUN: | FileCheck %s -check-prefix test1 RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test2.macho-i386 \ RUN: | FileCheck %s -check-prefix test2 -RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test3.macho-x86-64 \ +RUN: llvm-nm -m %p/Inputs/darwin-m-test3.macho-x86-64 \ RUN: | FileCheck %s -check-prefix test3 # This is testing that the various bits in the n_desc feild are correct diff --git a/llvm/test/Object/size-trivial-macho.test b/llvm/test/Object/size-trivial-macho.test index 6602d5651860..1642790c2c7b 100644 --- a/llvm/test/Object/size-trivial-macho.test +++ b/llvm/test/Object/size-trivial-macho.test @@ -8,7 +8,7 @@ RUN: llvm-size %p/Inputs/macho-archive-x86_64.a \ RUN: | FileCheck %s -check-prefix AR RUN: llvm-size -format darwin %p/Inputs/macho-archive-x86_64.a \ RUN: | FileCheck %s -check-prefix mAR -RUN: llvm-size -format darwin -x -l %p/Inputs/hello-world.macho-x86_64 \ +RUN: llvm-size -m -x -l %p/Inputs/hello-world.macho-x86_64 \ RUN: | FileCheck %s -check-prefix mxl RUN: llvm-size %p/Inputs/macho-universal.x86_64.i386 \ RUN: | FileCheck %s -check-prefix u diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 5062435d8971..cccddb0736d1 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -81,6 +81,7 @@ cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"), cl::opt BSDFormat("B", cl::desc("Alias for --format=bsd")); cl::opt POSIXFormat("P", cl::desc("Alias for --format=posix")); +cl::opt DarwinFormat("m", cl::desc("Alias for --format=darwin")); cl::opt PrintFileName( "print-file-name", @@ -828,6 +829,8 @@ int main(int argc, char **argv) { OutputFormat = bsd; if (POSIXFormat) OutputFormat = posix; + if (DarwinFormat) + OutputFormat = darwin; // The relative order of these is important. If you pass --size-sort it should // only print out the size. However, if you pass -S --size-sort, it should diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp index 408bb4a18804..b71380dcaa4a 100644 --- a/llvm/tools/llvm-size/llvm-size.cpp +++ b/llvm/tools/llvm-size/llvm-size.cpp @@ -46,6 +46,7 @@ static cl::opt OutputFormatShort(cl::desc("Specify output format"), cl::values(clEnumValN(sysv, "A", "System V format"), clEnumValN(berkeley, "B", "Berkeley format"), + clEnumValN(darwin, "m", "Darwin -m format"), clEnumValEnd), cl::init(berkeley));