diff --git a/llvm/test/tools/llvm-ml/parse_only.asm b/llvm/test/tools/llvm-ml/parse_only.asm new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ml/parse_only.asm @@ -0,0 +1,18 @@ +; RUN: llvm-ml %s /Zs /Fo - | FileCheck %s + +.code + +t1 PROC + ECHO Testing! + ret +t1 ENDP + +; check for the .text symbol (appears in both object files & .s output) +; CHECK-NOT: .text + +; CHECK: Testing! + +; check for the .text symbol (appears in both object files & .s output) +; CHECK-NOT: .text + +end diff --git a/llvm/test/tools/llvm-ml/parse_only_errors.asm b/llvm/test/tools/llvm-ml/parse_only_errors.asm new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ml/parse_only_errors.asm @@ -0,0 +1,18 @@ +; RUN: not llvm-ml %s /Zs /Fo - 2>&1 | FileCheck %s + +.code + +t1 PROC + blah + ret +t1 ENDP + +; check for the .text symbol (appears in both object files & .s output) +; CHECK-NOT: .text + +; CHECK: error: invalid instruction mnemonic 'blah' + +; check for the .text symbol (appears in both object files & .s output) +; CHECK-NOT: .text + +end diff --git a/llvm/tools/llvm-ml/Opts.td b/llvm/tools/llvm-ml/Opts.td --- a/llvm/tools/llvm-ml/Opts.td +++ b/llvm/tools/llvm-ml/Opts.td @@ -27,25 +27,6 @@ class UnsupportedSeparate : Separate<["/", "-"], name>, Group; -def help : MLFlag<"?">, - HelpText<"Display available options">; -def help_long : MLFlag<"help">, Alias; -def assemble_only : MLFlag<"c">, HelpText<"Assemble only; do not link">; -def define : MLJoinedOrSeparate<"D">, MetaVarName<"=">, - HelpText<"Define to (or blank if " - "omitted)">; -def output_file : MLJoinedOrSeparate<"Fo">, HelpText<"Names the output file">; -def include_path : MLJoinedOrSeparate<"I">, - HelpText<"Sets path for include files">; -def safeseh : MLFlag<"safeseh">, - HelpText<"Mark resulting object files as either containing no " - "exception handlers or containing exception handlers " - "that are all declared with .SAFESEH. Only available in " - "32-bit.">; -def assembly_file : MLJoinedOrSeparate<"Ta">, - HelpText<"Assemble source file with name not ending with " - "the .asm extension">; - def bitness : LLVMJoined<"m">, Values<"32,64">, HelpText<"Target platform (x86 or x86-64)">; def as_lex : LLVMFlag<"as-lex">, @@ -69,6 +50,27 @@ def save_temp_labels : LLVMFlag<"save-temp-labels">, HelpText<"Don't discard temporary labels">; +def help : MLFlag<"?">, + HelpText<"Display available options">; +def help_long : MLFlag<"help">, Alias; +def assemble_only : MLFlag<"c">, HelpText<"Assemble only; do not link">; +def define : MLJoinedOrSeparate<"D">, MetaVarName<"=">, + HelpText<"Define to (or blank if " + "omitted)">; +def output_file : MLJoinedOrSeparate<"Fo">, HelpText<"Names the output file">; +def include_path : MLJoinedOrSeparate<"I">, + HelpText<"Sets path for include files">; +def safeseh : MLFlag<"safeseh">, + HelpText<"Mark resulting object files as either containing no " + "exception handlers or containing exception handlers " + "that are all declared with .SAFESEH. Only available in " + "32-bit.">; +def assembly_file : MLJoinedOrSeparate<"Ta">, + HelpText<"Assemble source file with name not ending with " + "the .asm extension">; +def parse_only : MLFlag<"Zs">, HelpText<"Run a syntax-check only">, + Alias, AliasArgs<["null"]>; + def tiny_model_support : UnsupportedFlag<"AT">, HelpText<"">; def alternate_linker : UnsupportedJoined<"Bl">, HelpText<"">; def coff_object_file : UnsupportedFlag<"coff">, HelpText<"">; @@ -107,4 +109,3 @@ def codeview_info : UnsupportedFlag<"Zi">, HelpText<"">; def enable_m510_option : UnsupportedFlag<"Zm">, HelpText<"">; def structure_packing : UnsupportedJoined<"Zp">, HelpText<"">; -def parse_only : UnsupportedFlag<"Zs">, HelpText<"">;