[PATCH] [lld] Start of a test suite for the Darwin driver

Nick Kledzik kledzik at apple.com
Mon May 20 22:39:55 PDT 2013


Joe, Thanks for starting to help out with the mach-o part of lld.  Comments below:
 

+std::string MachOTargetInfo::PackedVersion::unparse() const {
+  std::string buffer;
+  llvm::raw_string_ostream str(buffer);
+  str << llvm::format("%i.%i.%i", _value >> 16, (_value >> 8) & 0xFF,
+                      _value & 0xFF);
+  return str.str();
+}

If you change this function to take a stream to write to, you won't need the stream and buffer temporaries.



+  if (parsedArgs->getLastArg(OPT_dump_args)) {
+    info.dumpArgs(llvm::outs());
+    return true;
+  }
+

This is called after validate() which sets up some defaults.  That will make for some unexpected output.  For instance, dumpArgs() will also add the -e option even if it was not specified.   We need to decide if dumpArgs() prints the minimal arguments or every possible argument with its default value (e.g. -image_base 0).  

-Nick

On May 20, 2013, at 3:42 PM, Joe Ranieri wrote:
> The ld64_test patch adds basic infrastructure for testing that the Darwin driver is parsing and validating command line arguments correctly. A flag, -dump_args, has been added to the driver that will print out all of the command line arguments that would create the MachOTargetInfo. This includes arguments whose values are deduced by MachOTargetInfo::validate.
> 
> The ld64_executable_fix patch fixes the handling of the static executables, making the test added in the first patch pass.
> 
> -- Joe Ranieri
> <ld64_executable_fix.diff><ld64_test.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130520/f9bffdd3/attachment.html>


More information about the llvm-commits mailing list