[libcxxabi] Introduce a -fno-exceptions libc++abi libary variant

Currently there is only support for a -fno-exceptions libc++ build. This is
problematic for functions such as std::terminate() which are defined in
libc++abi and using any of those functions throws away most of the benefits
of using -fno-exceptions (code-size). This patch introduces a -fno-exceptions
libc++abi build to address this issue.

This new variant of libc++abi cannot be linked against any with-exceptions
code as some symbols necessary for handling exceptions are missing in this
library.

Differential revision: http://reviews.llvm.org/D20677

Reviewers: EricWF, mclow.lists, bcraig
llvm-svn: 271267
diff --git a/libcxxabi/test/noexception2.pass.cpp b/libcxxabi/test/noexception2.pass.cpp
new file mode 100644
index 0000000..d9d10d5
--- /dev/null
+++ b/libcxxabi/test/noexception2.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------- noexception2.pass.cpp ------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// REQUIRES: libcxxabi-no-exceptions
+
+#include <cxxabi.h>
+#include <exception>
+#include <cassert>
+#include <stdlib.h>
+
+// namespace __cxxabiv1 {
+//      void __cxa_decrement_exception_refcount(void *thrown_object) throw();
+// }
+
+unsigned gCounter = 0;
+
+void my_terminate() { exit(0); }
+
+int main ()
+{
+    // should not call std::terminate()
+    __cxxabiv1::__cxa_decrement_exception_refcount(nullptr);
+
+    std::set_terminate(my_terminate);
+
+    // should call std::terminate()
+    __cxxabiv1::__cxa_decrement_exception_refcount((void*) &gCounter);
+    assert(false);
+
+    return 0;
+}