[all-commits] [llvm/llvm-project] 2d1fe0: [llvm][unittests] Fix ProgramEnvTest.TestExecuteAn...

rorth via All-commits all-commits at lists.llvm.org
Tue Jul 14 02:31:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d1fe0c372473a40a81309eefdd4d47a23160736
      https://github.com/llvm/llvm-project/commit/2d1fe0c372473a40a81309eefdd4d47a23160736
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2020-07-14 (Tue, 14 Jul 2020)

  Changed paths:
    M llvm/unittests/Support/ProgramTest.cpp

  Log Message:
  -----------
  [llvm][unittests] Fix ProgramEnvTest.TestExecuteAndWaitStatistics on Solaris

The new `LLVM-Unit :: Support/./SupportTests/ProgramEnvTest.TestExecuteAndWaitStatistics` test currently FAILs on Solaris:

  [ RUN      ] ProgramEnvTest.TestExecuteAndWaitStatistics
  /vol/llvm/src/llvm-project/local/llvm/unittests/Support/ProgramTest.cpp:360: Failure
  Expected: (ProcStat->PeakMemory) > (0U), actual: 0 vs 0
  [  FAILED  ] ProgramEnvTest.TestExecuteAndWaitStatistics (22 ms)

According to `llvm/lib/Support/Unix/Program.inc (llvm::sys::Wait)`, `PeakMemory`
corresponds to `struct rusage.ru_maxrss`.

However, Solaris `getrusage(3C)` documents

  NOTES
         The ru_maxrss, ru_ixrss, ru_idrss, and ru_isrss members of  the  rusage
         structure are set to 0 in this implementation.

Since changing the test to check for `PeakMemory >= 0` instead is pointless
and would generate a warning on targets where `ru_maxrss` is unsigned, this
patch removes the check.

Tested on `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D83661




More information about the All-commits mailing list