This is an archive of the discontinued LLVM Phabricator instance.

libcxx: Fix path.compare.pass expected result
ClosedPublic

Authored by zatrazz on Aug 12 2016, 7:15 AM.

Details

Summary

The expected 'filesystem::path::compare' result states that for different
only the sign of result integer contains the information about passed
arguments. This is because it uses the output of other compare function
(basic_string_view and char_traits) without further handling and
char_traits uses memcmp for final buffer comparison.

However for GLIBC on AArch64 the code:

int ret = memcmp ("b/a/c", "a/b/c", 1);

Results in '64' where for x86_64 it results in '1'.

This patch fixes the expected 'filesystem::path::compare' by normalizing
all the results before assert comparison.

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 67836.Aug 12 2016, 7:15 AM
zatrazz retitled this revision from to libcxx: Fix path.compare.pass expected result.
zatrazz updated this object.
zatrazz added reviewers: jroelofs, danalbert, EricWF.
EricWF accepted this revision.Aug 15 2016, 11:59 AM
EricWF edited edge metadata.
This revision is now accepted and ready to land.Aug 15 2016, 11:59 AM
zatrazz closed this revision.Aug 15 2016, 2:32 PM