[compiler-rt] r235654 - [Sanitizer] Fix getpwnam test on ppc64le Fedora 21.

Jay Foad jay.foad at gmail.com
Thu Apr 23 15:20:33 PDT 2015


Author: foad
Date: Thu Apr 23 17:20:33 2015
New Revision: 235654

URL: http://llvm.org/viewvc/llvm-project?rev=235654&view=rev
Log:
[Sanitizer] Fix getpwnam test on ppc64le Fedora 21.

Summary:
On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT
instead of 0. Tolerate this in the test case.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9233

Modified:
    compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc?rev=235654&r1=235653&r2=235654&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc Thu Apr 23 17:20:33 2015
@@ -2,6 +2,7 @@
 // RUN: %clangxx -O0 -g %s -o %t && %run %t
 
 #include <assert.h>
+#include <errno.h>
 #include <pwd.h>
 #include <signal.h>
 #include <stdio.h>
@@ -13,7 +14,7 @@ int main(void) {
   struct passwd *pwdres;
   char buf[10000];
   int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
-  assert(res == 0);
+  assert(res == 0 || res == ENOENT);
   assert(pwdres == 0);
   return 0;
 }





More information about the llvm-commits mailing list