summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-10-24 12:08:24 -0700
committerVedant Kumar <vsk@apple.com>2019-10-24 13:19:49 -0700
commitd0bd3fc88be54c4e11f49cfa31e427700bb1e9af (patch)
treeef4c379867706eb435d84356414aae10984a5fd3 /llvm/unittests/Support
parent23b78364150cd946a8b111e87defdf179eecbc8f (diff)
downloadbcm5719-llvm-d0bd3fc88be54c4e11f49cfa31e427700bb1e9af.tar.gz
bcm5719-llvm-d0bd3fc88be54c4e11f49cfa31e427700bb1e9af.zip
Revert "Disable exit-on-SIGPIPE in lldb"
This reverts commit 32ce14e55e5a99dd99c3b4fd4bd0ccaaf2948c30. In post-commit review, Pavel pointed out that there's a simpler way to ignore SIGPIPE in lldb that doesn't rely on llvm's handlers.
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r--llvm/unittests/Support/CMakeLists.txt1
-rw-r--r--llvm/unittests/Support/SignalsTest.cpp54
2 files changed, 0 insertions, 55 deletions
diff --git a/llvm/unittests/Support/CMakeLists.txt b/llvm/unittests/Support/CMakeLists.txt
index 385142278e4..161891517cf 100644
--- a/llvm/unittests/Support/CMakeLists.txt
+++ b/llvm/unittests/Support/CMakeLists.txt
@@ -58,7 +58,6 @@ add_llvm_unittest(SupportTests
ReverseIterationTest.cpp
ReplaceFileTest.cpp
ScaledNumberTest.cpp
- SignalsTest.cpp
SourceMgrTest.cpp
SpecialCaseListTest.cpp
StringPool.cpp
diff --git a/llvm/unittests/Support/SignalsTest.cpp b/llvm/unittests/Support/SignalsTest.cpp
deleted file mode 100644
index 8c595c203ae..00000000000
--- a/llvm/unittests/Support/SignalsTest.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//========- unittests/Support/SignalsTest.cpp - Signal handling test =========//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#if !defined(_WIN32)
-#include <unistd.h>
-#include <sysexits.h>
-#include <signal.h>
-#endif // !defined(_WIN32)
-
-#include "llvm/Support/Signals.h"
-
-#include "gtest/gtest.h"
-
-using namespace llvm;
-
-#if !defined(_WIN32)
-TEST(SignalTest, IgnoreMultipleSIGPIPEs) {
- // Ignore SIGPIPE.
- signal(SIGPIPE, SIG_IGN);
-
- // Disable exit-on-SIGPIPE.
- sys::SetPipeSignalFunction(nullptr);
-
- // Create unidirectional read/write pipes.
- int fds[2];
- int err = pipe(fds);
- if (err != 0)
- return; // If we can't make pipes, this isn't testing anything.
-
- // Close the read pipe.
- close(fds[0]);
-
- // Attempt to write to the write pipe. Currently we're asserting that the
- // write fails, which isn't great.
- //
- // What we really want is a death test that checks that this block exits
- // with a special exit "success" code, as opposed to unexpectedly exiting due
- // to a kill-by-SIGNAL or due to the default SIGPIPE handler.
- //
- // Unfortunately llvm's unit tests aren't set up to support death tests well.
- // For one, death tests are flaky in a multithreaded context. And sigactions
- // inherited from llvm-lit interfere with what's being tested.
- const void *buf = (const void *)&fds;
- err = write(fds[1], buf, 1);
- ASSERT_EQ(err, -1);
- err = write(fds[1], buf, 1);
- ASSERT_EQ(err, -1);
-}
-#endif // !defined(_WIN32)
OpenPOWER on IntegriCloud