On Fri, May 28, 2010 at 4:28 PM, Eli Friedman <eli.friedman at gmail.com> wrote:> > Any objections for not accepting the patch into LLVM? If none, I'll > > apply it after the weekend. > > There should minimally be a bare-bones test to make sure that basic > COFF writer functionality doesn't crash. Besides that, I don't see > any issues.I was looking into writing this test for MC based on the MachO tests, but llvm-mc cannot read .s files as COFF because it simply lacks support for it. It tries to read everything as MachO. I've attached a patch for the test anyway. This includes Nathan's dump-coff.py script in the proper location for the test. I generated the .s file with "echo int main(){} | clang -O3 -S -x c -o - -". And then I generated the CHECK lines by running "echo int main(){} | clang -O3 -c -x c -o temp.o - && dump-coff temp.o". - Michael Spencer -------------- next part -------------- A non-text attachment was scrubbed... Name: basic-coff-tests.patch Type: application/octet-stream Size: 18356 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100609/c4017916/attachment.obj>
This is cool, I was looking into something like this, but hit a little bit of a wall, and then got sidetracked on another project. I was going to use llc to generate COFF object files as opposed to clang. Seems to me llc would give better control over what was generated and would also not require clang to be in the tree. Is there any documentation on how to run these tests from windows? - Nathan On Wed, Jun 9, 2010 at 3:15 PM, Bigcheese <bigcheesegs at gmail.com> wrote:> On Fri, May 28, 2010 at 4:28 PM, Eli Friedman <eli.friedman at gmail.com> > wrote: > > > Any objections for not accepting the patch into LLVM? If none, I'll > > > apply it after the weekend. > > > > There should minimally be a bare-bones test to make sure that basic > > COFF writer functionality doesn't crash. Besides that, I don't see > > any issues. > > I was looking into writing this test for MC based on the MachO tests, > but llvm-mc cannot read .s files as COFF because it simply lacks > support for it. It tries to read everything as MachO. > > I've attached a patch for the test anyway. This includes Nathan's > dump-coff.py script in the proper location for the test. I generated > the .s file with "echo int main(){} | clang -O3 -S -x c -o - -". And > then I generated the CHECK lines by running "echo int main(){} | clang > -O3 -c -x c -o temp.o - && dump-coff temp.o". > > - Michael Spencer > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100609/0cadaabe/attachment.html>
On Wed, Jun 9, 2010 at 11:11 PM, Nathan Jeffords <blunted2night at gmail.com> wrote:> This is cool, I was looking into something like this, but hit a little bit > of a wall, and then got sidetracked on another project. I was going to use > llc to generate COFF object files as opposed to clang. Seems to me llc would > give better control over what was generated and would also not require clang > to be in the tree. > Is there any documentation on how to run these tests from windows?I just tried to actually run the tests in llvm/test (as opposed to llvm/tools/clang/test) and none of them work on windows. They all fail due to windows using \ for directories, which the test runner seems to want to use as an escape sequence. What I don't get is how clang tests run fine on windows, but not llvm tests. And why I have not seen this problem posted anywhere. - Michael Spencer
On Wed, 9 Jun 2010 18:15:23 -0400, Bigcheese <bigcheesegs at gmail.com> wrote:> > I was looking into writing this test for MC based on the MachO tests, > but llvm-mc cannot read .s files as COFF because it simply lacks > support for it. It tries to read everything as MachO.FYI, I've been working wth Daniel to try and pull all the Mach-O specific things out of llvm-mc and lib/MC and put them into object file classes. Once those patches are merged it should be a small matter of programming to get COFF support for llvm-mc, given that the ObjectWriter and Streamer stuff is already written.
On Sun, Jun 13, 2010 at 6:34 AM, Matt Fleming <matt at console-pimps.org> wrote:> FYI, I've been working wth Daniel to try and pull all the Mach-O > specific things out of llvm-mc and lib/MC and put them into object file > classes. Once those patches are merged it should be a small matter of > programming to get COFF support for llvm-mc, given that the ObjectWriter > and Streamer stuff is already written.How would this work? Aren't there object type specific directives in assembly files? I know some people are working on native linkers for LLVM. It would be interesting to see an architecture for handling object files that could be shared between lib/MC and a linker. - Michael Spencer