This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add PDB/calling-conventions.test for Arm/Windows
ClosedPublic

Authored by omjavaid on Jun 27 2022, 1:06 PM.

Details

Summary

This patch renames PDB/calling-conventions.test to calling-conventions-x86.test.
Also restrict it to run only for target-x86*.
This patch also adds a arm specific test PDB/calling-conventions-arm.test which
tests that x86 specifc calling convention decorators are ignored by Arm compiler.

Diff Detail

Event Timeline

omjavaid created this revision.Jun 27 2022, 1:06 PM
omjavaid requested review of this revision.Jun 27 2022, 1:06 PM

There's consistent typos about the test name in the commit subject and description.

lldb/test/Shell/SymbolFile/PDB/calling-conventions-arm.test
2

Hmm, I wasn't aware of the fact that you can do such || expressions in the REQUIRES line - I presume you've verified that this test actually does get picked up and executed?

3

Here, there's probably no need to force it to 32 bit mode - unless we expect to have a similar test for the undecorated mangling in aarch64 and x86_64 mode too?

omjavaid retitled this revision from [LLDB] Add PDB/Calling-conentions.test for Arm/Windows to [LLDB] Add PDB/calling-conventions.test for Arm/Windows.Jun 28 2022, 5:01 AM
omjavaid edited the summary of this revision. (Show Details)
omjavaid added inline comments.Jun 28 2022, 5:08 AM
lldb/test/Shell/SymbolFile/PDB/calling-conventions-arm.test
2

This is tested on both Arm/Windows and x86/Windows.

3

Mangling is specific to x86 32 bit only. All other configs shouldnt do it. I guess we can test it for both 64bit and 32bit arm. Let me update my change.

omjavaid updated this revision to Diff 440581.Jun 28 2022, 5:53 AM

Added test for AArch64 and x64 calling conventions.

labath added a subscriber: labath.Jun 28 2022, 7:05 AM

It seems like this is not actually running the code. Can we make it such that these tests are conditional on the appropriate llvm targets being enabled (instead of the host being of a specific type)?

Thanks, this looks more complete and consistent to me now!

It seems like this is not actually running the code. Can we make it such that these tests are conditional on the appropriate llvm targets being enabled (instead of the host being of a specific type)?

Well it does need being able to link executables for these targets, which you generally can't rely on I think? (I don't think the %build macro in general works as a cross compiler?)

Thanks, this looks more complete and consistent to me now!

It seems like this is not actually running the code. Can we make it such that these tests are conditional on the appropriate llvm targets being enabled (instead of the host being of a specific type)?

Well it does need being able to link executables for these targets, which you generally can't rely on I think? (I don't think the %build macro in general works as a cross compiler?)

We can compile the test on linux as it doesnt require any libraries i-e --nodefaultlib. However its MS DIA SDK based PDB test which is only available on system windows. NATIVE PDB reader tests are already being run independently.

Thanks, this looks more complete and consistent to me now!

It seems like this is not actually running the code. Can we make it such that these tests are conditional on the appropriate llvm targets being enabled (instead of the host being of a specific type)?

Well it does need being able to link executables for these targets, which you generally can't rely on I think? (I don't think the %build macro in general works as a cross compiler?)

What Omair said. And, generally speaking, I'm not convinced of the usefulness of the %build script. It lacked sufficient buy-in from the start is now pretty much exclusively used for windows tests. It supports both cross-compilation and host-compilation modes, but it's very inconsistent about which one it uses for a particular combination of flags and compilers.
Overall, I don't think we need any kind of scripts for cross-compilation -- we can just issue appropriate clang and lld commands ourselves. There /might/ be a use case for host-compilation, but I suspect that could also be achieved with more conventional means (a couple of well-placed substitutions).

However its MS DIA SDK based PDB test which is only available on system windows. NATIVE PDB reader tests are already being run independently.

Ok, that makes sense. Thanks.

labath accepted this revision.Jun 29 2022, 1:34 AM
This revision is now accepted and ready to land.Jun 29 2022, 1:34 AM
This revision was automatically updated to reflect the committed changes.
lldb/test/Shell/SymbolFile/PDB/calling-conventions-x86.test