[compiler-rt] r189339 - [msan] A test for ppoll() interceptor.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue Aug 27 04:10:21 PDT 2013
Author: eugenis
Date: Tue Aug 27 06:10:20 2013
New Revision: 189339
URL: http://llvm.org/viewvc/llvm-project?rev=189339&view=rev
Log:
[msan] A test for ppoll() interceptor.
Modified:
compiler-rt/trunk/lib/msan/tests/msan_test.cc
Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=189339&r1=189338&r2=189339&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Tue Aug 27 06:10:20 2013
@@ -731,6 +731,31 @@ TEST(MemorySanitizer, poll) {
close(pipefd[1]);
}
+TEST(MemorySanitizer, ppoll) {
+ int* pipefd = new int[2];
+ int res = pipe(pipefd);
+ ASSERT_EQ(0, res);
+
+ char data = 42;
+ res = write(pipefd[1], &data, 1);
+ ASSERT_EQ(1, res);
+
+ pollfd fds[2];
+ fds[0].fd = pipefd[0];
+ fds[0].events = POLLIN;
+ fds[1].fd = pipefd[1];
+ fds[1].events = POLLIN;
+ sigset_t ss;
+ sigemptyset(&ss);
+ res = ppoll(fds, 2, NULL, &ss);
+ ASSERT_EQ(1, res);
+ EXPECT_NOT_POISONED(fds[0].revents);
+ EXPECT_NOT_POISONED(fds[1].revents);
+
+ close(pipefd[0]);
+ close(pipefd[1]);
+}
+
TEST(MemorySanitizer, poll_positive) {
int* pipefd = new int[2];
int res = pipe(pipefd);
More information about the llvm-commits
mailing list