This is an archive of the discontinued LLVM Phabricator instance.

[libc++][lit][AIX] Enable test case last_write_time.pass.cpp for AIX
ClosedPublic

Authored by xingxue on Sep 1 2022, 10:17 AM.

Details

Summary

This patch enables libc++ LIT test case last_write_time.pass.cpp for AIX. Because system call utimensat() of AIX which is used in the libc++ implementation of last_write_time() does not accept the times parameter with a negative tv_sec or tv_nsec field, testing of setting file time to before epoch time is excluded for AIX.

This is the AIX utimensat() man page, noting utimensat() returns -1 with errno set to EINVAL - The Times parameter has a negative tv_sec field.

Diff Detail

Event Timeline

xingxue created this revision.Sep 1 2022, 10:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2022, 10:17 AM
xingxue requested review of this revision.Sep 1 2022, 10:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2022, 10:17 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
xingxue edited the summary of this revision. (Show Details)Sep 8 2022, 2:16 PM
ldionne requested changes to this revision.Sep 9 2022, 6:39 AM
ldionne added inline comments.
libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
501–502

Instead, can we move the comment above to here, always define before_epoch_time & friends, and only have one #ifdef block? That will reduce the scope of the workaround.

This revision now requires changes to proceed.Sep 9 2022, 6:39 AM
xingxue added inline comments.Sep 9 2022, 7:40 AM
libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
501–502

Defining before_epoch_time and friends without using them will fail the test because of -Werror,-Wunused-variable.

ldionne added inline comments.Sep 15 2022, 12:41 PM
libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
501–502

You can use (void) to silence it!

xingxue updated this revision to Diff 460846.Sep 16 2022, 12:23 PM

Addressed comments:

  • always define before_epoch_time & friends to reduce the scope of the workaround.
ldionne accepted this revision.Sep 16 2022, 12:23 PM
This revision is now accepted and ready to land.Sep 16 2022, 12:23 PM
xingxue marked 2 inline comments as done.Sep 16 2022, 12:26 PM
xingxue added inline comments.
libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
501–502

Ah, I see, thanks!

This revision was landed with ongoing or failed builds.Sep 16 2022, 1:09 PM
This revision was automatically updated to reflect the committed changes.
xingxue marked an inline comment as done.