summaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Posix/getusershell.cc
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2019-01-18 19:46:00 +0000
committerJordan Rupprecht <rupprecht@google.com>2019-01-18 19:46:00 +0000
commit05342ccc9cff16425c0a831fddd510879544a0bf (patch)
treed86b2dfee6aa9d3a54d6d21aabb6bd7462b6669b /test/sanitizer_common/TestCases/Posix/getusershell.cc
parent6fc0ad0a5de45f80140620e2dd606f65d547362a (diff)
parentb15181368831966c0ec1824617a4c95853fd1b92 (diff)
downloadcompiler-rt-05342ccc9cff16425c0a831fddd510879544a0bf.tar.gz
Creating branches/google/stable and tags/google/stable/2019-01-18 from r351319
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/google/stable@351578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common/TestCases/Posix/getusershell.cc')
-rw-r--r--test/sanitizer_common/TestCases/Posix/getusershell.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/getusershell.cc b/test/sanitizer_common/TestCases/Posix/getusershell.cc
new file mode 100644
index 000000000..c00d75f11
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Posix/getusershell.cc
@@ -0,0 +1,23 @@
+// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
+
+// UNSUPPORTED: android
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int main(void) {
+ printf("getusershell\n");
+
+ setusershell();
+ char *fentry = getusershell();
+
+ printf("First entry: '%s'\n", fentry);
+
+ endusershell();
+
+ return 0;
+ // CHECK: getusershell
+ // CHECK: First entry: '{{.*}}'
+}