This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Testsuite: Add helper to check for AArch64 target
ClosedPublic

Authored by omjavaid on Jul 6 2021, 7:47 AM.

Details

Summary

This patch adds a helper function to test target architecture is AArch64 or not. This also tightens isAArch64* helpers by adding an extra architecture check.

Diff Detail

Event Timeline

omjavaid created this revision.Jul 6 2021, 7:47 AM
omjavaid requested review of this revision.Jul 6 2021, 7:47 AM
DavidSpickett added inline comments.Jul 6 2021, 8:17 AM
lldb/packages/Python/lldbsuite/test/lldbtest.py
1296

This can be:

return self.getArchitecture().lower() == "aarch64"

Unless you're expecting "aarch64_be" or "aarch64_32" as well.

return "aarch64" in self.getArchitecture().lower()

Not sure if lldb just has the single name.

omjavaid added inline comments.Jul 7 2021, 5:52 AM
lldb/packages/Python/lldbsuite/test/lldbtest.py
1296

This was intentional as I wanted to keep this helper checking for platform architecture regardless of ABI or endianess. For an ILP32 inferior or be inferior our Native* are same as normal aarch64.

DavidSpickett added inline comments.Jul 8 2021, 1:50 AM
lldb/packages/Python/lldbsuite/test/lldbtest.py
1296

I still think

return self.getArchitecture().lower() == "aarch64"

Is the same thing unless you intend to expand the list.

(but I understand what you're doing and either way works just a bit less neat IMO)

omjavaid added inline comments.Jul 11 2021, 8:53 PM
lldb/packages/Python/lldbsuite/test/lldbtest.py
1296

Oh yes agreed, I dunno what I was thinking :) Let me fix this.

omjavaid updated this revision to Diff 357837.Jul 11 2021, 8:57 PM

This fixes issue raised in last rev.

DavidSpickett accepted this revision.Jul 12 2021, 1:34 AM
This revision is now accepted and ready to land.Jul 12 2021, 1:34 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2021, 2:22 AM