Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: tests/toolchain/synchronization_cpp11.cc

Issue 639113003: Add nacl-clang testing to SCons (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: ncbray comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/toolchain/nacl.scons ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/toolchain/synchronization_cpp11.cc
diff --git a/tests/toolchain/synchronization_cpp11.cc b/tests/toolchain/synchronization_cpp11.cc
index 9f26a717954075ecd62ab8e46f9d63966ae55593..2ebca5887bd22c2b142a2762674d2394e300722c 100644
--- a/tests/toolchain/synchronization_cpp11.cc
+++ b/tests/toolchain/synchronization_cpp11.cc
@@ -46,6 +46,7 @@
* lock-free: we can't guarantee that all our platforms are lock-free.
*/
void test_lock_free_macros() {
+#if defined(__pnacl__)
static_assert(ATOMIC_BOOL_LOCK_FREE == 1, "should be compile-time 1");
static_assert(ATOMIC_CHAR_LOCK_FREE == 1, "should be compile-time 1");
static_assert(ATOMIC_CHAR16_T_LOCK_FREE == 1, "should be compile-time 1");
@@ -56,6 +57,20 @@ void test_lock_free_macros() {
static_assert(ATOMIC_LONG_LOCK_FREE == 1, "should be compile-time 1");
static_assert(ATOMIC_LLONG_LOCK_FREE == 1, "should be compile-time 1");
static_assert(ATOMIC_POINTER_LOCK_FREE == 1, "should be compile-time 1");
+#elif defined(__x86_64__) || defined(__i386__) || defined(__arm__)
+ static_assert(ATOMIC_BOOL_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_CHAR_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_CHAR16_T_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_CHAR32_T_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_WCHAR_T_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_SHORT_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_INT_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_LONG_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_LLONG_LOCK_FREE == 2, "should be compile-time 2");
+ static_assert(ATOMIC_POINTER_LOCK_FREE == 2, "should be compile-time 2");
+# else
+ // TODO: Other architechtures, such as mips
+#endif
}
#define TEST_IS_LOCK_FREE(TYPE) do { \
« no previous file with comments | « tests/toolchain/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698