summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/test/std/atomics/atomics.flag/default.pass.cpp4
-rw-r--r--libcxx/test/std/atomics/atomics.types.generic/address.pass.cpp4
-rw-r--r--libcxx/test/std/atomics/atomics.types.generic/bool.pass.cpp4
-rw-r--r--libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp4
-rw-r--r--libcxx/test/support/test_macros.h6
6 files changed, 21 insertions, 5 deletions
diff --git a/libcxx/test/std/atomics/atomics.flag/default.pass.cpp b/libcxx/test/std/atomics/atomics.flag/default.pass.cpp
index 11c08f50266..b4c2b9c8083 100644
--- a/libcxx/test/std/atomics/atomics.flag/default.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.flag/default.pass.cpp
@@ -19,6 +19,8 @@
#include <new>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
std::atomic_flag f;
@@ -26,7 +28,7 @@ int main()
assert(f.test_and_set() == 0);
{
typedef std::atomic_flag A;
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
A& zero = *new (storage) A();
assert(!zero.test_and_set());
zero.~A();
diff --git a/libcxx/test/std/atomics/atomics.types.generic/address.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/address.pass.cpp
index 137e46b6a15..c31a99c9b9a 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/address.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/address.pass.cpp
@@ -75,6 +75,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
template <class A, class T>
void
do_test()
@@ -121,7 +123,7 @@ do_test()
assert(obj == T(2*sizeof(X)));
{
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
A& zero = *new (storage) A();
assert(zero == T(0));
zero.~A();
diff --git a/libcxx/test/std/atomics/atomics.types.generic/bool.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/bool.pass.cpp
index e85893d12b8..ba38154ed46 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/bool.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/bool.pass.cpp
@@ -57,6 +57,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
int main()
{
{
@@ -226,7 +228,7 @@ int main()
}
{
typedef std::atomic<bool> A;
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
A& zero = *new (storage) A();
assert(zero == false);
zero.~A();
diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
index a449dc6d5f5..8cb76baf83b 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
@@ -92,6 +92,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
template <class A, class T>
void
do_test()
@@ -151,7 +153,7 @@ do_test()
assert(obj == T(8));
{
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
A& zero = *new (storage) A();
assert(zero == 0);
zero.~A();
diff --git a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 4ee95fdf300..9f57a201a21 100644
--- a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -18,12 +18,14 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
public:
explicit A(int data) : data_(data) {}
- virtual ~A() _NOEXCEPT {}
+ virtual ~A() TEST_NOEXCEPT {}
friend bool operator==(const A& x, const A& y) {return x.data_ == y.data_;}
};
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 0d85ff60f33..ea7073e0241 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -94,13 +94,19 @@
# else
# define TEST_CONSTEXPR_CXX14
# endif
+#define TEST_ALIGNOF(...) alignof(__VA_ARGS__)
+#define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
#else
#define TEST_CONSTEXPR
#define TEST_CONSTEXPR_CXX14
#define TEST_NOEXCEPT
#define TEST_NOEXCEPT_COND(...)
+#define TEST_ALIGNOF(...) __alignof(__VA_ARGS__)
+#define TEST_ALIGNAS(...) __attribute__((__aligned__(__VA_ARGS__)))
#endif
+#define TEST_ALIGNAS_TYPE(...) TEST_ALIGNAS(TEST_ALIGNOF(__VA_ARGS__))
+
#if !TEST_HAS_FEATURE(cxx_rtti) && !defined(__cpp_rtti) \
&& !defined(__GXX_RTTI)
#define TEST_HAS_NO_RTTI
OpenPOWER on IntegriCloud