[compiler-rt] r263017 - [test/sanitizer-common] Move getpass.cc from Linux into Posix
Filipe Cabecinhas via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 07:39:43 PST 2016
Author: filcab
Date: Wed Mar 9 09:39:43 2016
New Revision: 263017
URL: http://llvm.org/viewvc/llvm-project?rev=263017&view=rev
Log:
[test/sanitizer-common] Move getpass.cc from Linux into Posix
Added:
compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/getpass.cc
- copied, changed from r263010, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc
Removed:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc
Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc?rev=263016&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx -O0 -g %s -lutil -o %t && %run %t | FileCheck %s
-// REQUIRES: stable-runtime
-#include <assert.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <pty.h>
-
-int
-main (int argc, char** argv)
-{
- int master;
- int pid = forkpty(&master, NULL, NULL, NULL);
-
- if(pid == -1) {
- fprintf(stderr, "forkpty failed\n");
- return 1;
- } else if (pid > 0) {
- char buf[1024];
- int res = read(master, buf, sizeof(buf));
- write(1, buf, res);
- write(master, "password\n", 9);
- while ((res = read(master, buf, sizeof(buf))) > 0) write(1, buf, res);
- } else {
- char *s = getpass("prompt");
- assert(strcmp(s, "password") == 0);
- write(1, "done\n", 5);
- }
- return 0;
-}
-
-// CHECK: prompt
-// CHECK: done
Copied: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/getpass.cc (from r263010, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/getpass.cc?p2=compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/getpass.cc&p1=compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc&r1=263010&r2=263017&rev=263017&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/getpass.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/getpass.cc Wed Mar 9 09:39:43 2016
@@ -4,7 +4,11 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
+#if __linux__
#include <pty.h>
+#else
+#include <util.h>
+#endif
int
main (int argc, char** argv)
More information about the llvm-commits
mailing list