summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-08-19 20:43:24 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-08-19 20:43:24 +0000
commitd78cfd57eb297ad74a31c9f5913f6957f1c22ce6 (patch)
tree9e9714c695da2efd49ba68555d5f52bc1d4b272e
parent335e653fe625248b99b1001060f60a2bda79cd3e (diff)
downloadbcm5719-llvm-d78cfd57eb297ad74a31c9f5913f6957f1c22ce6.tar.gz
bcm5719-llvm-d78cfd57eb297ad74a31c9f5913f6957f1c22ce6.zip
Do not depend on the standard library on the system. Replace the #include with
the relevant section of libcxx. As an aside, I am not at all confident that this test is still testing that it's supposed to. llvm-svn: 138075
-rw-r--r--clang/test/CodeGenCXX/weak-external.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/weak-external.cpp b/clang/test/CodeGenCXX/weak-external.cpp
index f1ecc890abe..dad54f6861b 100644
--- a/clang/test/CodeGenCXX/weak-external.cpp
+++ b/clang/test/CodeGenCXX/weak-external.cpp
@@ -12,7 +12,54 @@
// template, it's instantiation is *not* suppressed (despite being in
// basic_string<char>), so we would emit it as a weak definition.
-#include <stdexcept>
+#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default")))
+#if (__has_feature(cxx_noexcept))
+# define _NOEXCEPT noexcept
+# define _NOEXCEPT_(x) noexcept(x)
+#else
+# define _NOEXCEPT throw()
+# define _NOEXCEPT_(x)
+#endif
+
+namespace std // purposefully not using versioning namespace
+{
+
+template<class charT> struct char_traits;
+template<class T> class allocator;
+template <class _CharT,
+ class _Traits = char_traits<_CharT>,
+ class _Allocator = allocator<_CharT> >
+ class _LIBCPP_VISIBLE basic_string;
+typedef basic_string<char, char_traits<char>, allocator<char> > string;
+
+class _LIBCPP_EXCEPTION_ABI exception
+{
+public:
+ _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
+ virtual ~exception() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+class _LIBCPP_EXCEPTION_ABI runtime_error
+ : public exception
+{
+private:
+ void* __imp_;
+public:
+ explicit runtime_error(const string&);
+ explicit runtime_error(const char*);
+
+ runtime_error(const runtime_error&) _NOEXCEPT;
+ runtime_error& operator=(const runtime_error&) _NOEXCEPT;
+
+ virtual ~runtime_error() _NOEXCEPT;
+
+ virtual const char* what() const _NOEXCEPT;
+};
+
+}
void dummysymbol() {
throw(std::runtime_error("string"));
OpenPOWER on IntegriCloud