This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add a test for inline assembly when targeting armv7-windows
AbandonedPublic

Authored by mstorsjo on Jul 27 2016, 5:53 AM.

Details

Reviewers
rengolin
Summary

This test uses an immediate constant, which was previously broken in inline assembly, prior to LLVM r276859.

Diff Detail

Event Timeline

mstorsjo updated this revision to Diff 65715.Jul 27 2016, 5:53 AM
mstorsjo retitled this revision from to [ARM] Add a test for inline assembly when targeting armv7-windows.
mstorsjo updated this object.
mstorsjo added a subscriber: cfe-commits.
rengolin accepted this revision.Jul 27 2016, 6:02 AM
rengolin added a reviewer: rengolin.
This revision is now accepted and ready to land.Jul 27 2016, 6:02 AM

I'll just echo @compnerd comments, since Phab didn't get it.

  • Change the syntax to asm, to be more portable
  • Add Microsoft asm block syntax

cheers,
--renato

rengolin requested changes to this revision.Jul 27 2016, 7:49 AM
rengolin edited edge metadata.
rengolin added inline comments.
test/CodeGen/arm-inline-asm-windows.c
2

Also, I just noticed, this outputs the binary to stdout. Maybe better

-o /dev/null

or whatever is the practice on Windows that also work on Linux. :)

This revision now requires changes to proceed.Jul 27 2016, 7:49 AM

Is r276859 fixing a bug in the assembler?

I'm trying to understand why we have to add a clang test in this particular case because I don't think we normally add a test in clang every time we fix a bug in the backend or assembler.

Is r276859 fixing a bug in the assembler?

Sort of. It was just adding a comment character to ; instead of #.

I'm trying to understand why we have to add a clang test in this particular case because I don't think we normally add a test in clang every time we fix a bug in the backend or assembler.

As I read it, this is just making sure "inline asm" works on Windows, which apparently hasn't been working so far. In a way, unrelated to the commit in question.

I agree we shouldn't be adding clang tests to assembler bugs.

I'll just echo @compnerd comments, since Phab didn't get it.

  • Change the syntax to asm, to be more portable
  • Add Microsoft asm block syntax

MSVC doesn't support inline assembly on ARM at all (they only support that on 32 bit x86), so there's none of their syntax to support or test.

As I read it, this is just making sure "inline asm" works on Windows, which apparently hasn't been working so far. In a way, unrelated to the commit in question.

No, inline assembly has been working, but only for assembly that didn't contain any immediate values.

I agree we shouldn't be adding clang tests to assembler bugs.

Ok, we can skip this test if you prefer - the assembler test added for llvm-mc should be fine and enough as well.

Ok, sounds good. Feel free to abandon this one as well.

cheers,
--renato

mstorsjo abandoned this revision.Jul 27 2016, 10:47 PM

This test isn't strictly necessary, thus abandoning