This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests
ClosedPublic

Authored by SjoerdMeijer on Aug 2 2018, 3:40 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

SjoerdMeijer created this revision.Aug 2 2018, 3:40 AM
olista01 added inline comments.Aug 8 2018, 6:45 AM
test/Driver/aarch64-cpus.c
10 ↗(On Diff #158717)

Why do these need new check prefixes? All of the RUN lines above are selecting little-endian, so I'd expect GENERIC and GENERIC-LE to be the same.

SjoerdMeijer added inline comments.Aug 8 2018, 7:16 AM
test/Driver/aarch64-cpus.c
10 ↗(On Diff #158717)

Ok, good point. The output is slightly different. For the little-endian runs above the output is:

"-triple" "aarch64"

and with "-target aarch64_be -mlittle-endian" the output is:

"-triple" "aarch64--"

As we don't want to be too generic and match "aarch64{{.*}}", I will therefore change the GENERIC checks to match "aarch64{{[--]*}}", and indeed remove GENERIC-LE.

Addressed comments.

olista01 added inline comments.Aug 9 2018, 6:20 AM
test/Driver/aarch64-cpus.c
10 ↗(On Diff #158717)

I think that works, but it's a strange way to write the regex. You have "-" twice inside a character set, which is the same as only having it once, so "[--]*" matches zero or more occurrences of "-". I'd suggest using something like "(--)?" which matches either "--" or nothing.

SjoerdMeijer added inline comments.Aug 9 2018, 6:33 AM
test/Driver/aarch64-cpus.c
10 ↗(On Diff #158717)

Ah, of course, thanks! That was a bit silly, will fix.

Addressed comments.

olista01 accepted this revision.Aug 9 2018, 6:55 AM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 9 2018, 6:55 AM
This revision was automatically updated to reflect the committed changes.