Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sync Since clang doesn't recognize the nand v...



details:   https://anonhg.NetBSD.org/src/rev/e9168233bbad
branches:  trunk
changeset: 326789:e9168233bbad
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Feb 17 21:38:04 2014 +0000

description:
Since clang doesn't recognize the nand variants of the sync builtins and
gcc doesn't support __has_builtin, use a plain #ifndef __clang__ check
as workaround.

diffstat:

 tests/lib/libc/sync/all_sync_ops_linkable.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 991f54a88949 -r e9168233bbad tests/lib/libc/sync/all_sync_ops_linkable.c
--- a/tests/lib/libc/sync/all_sync_ops_linkable.c       Mon Feb 17 21:29:29 2014 +0000
+++ b/tests/lib/libc/sync/all_sync_ops_linkable.c       Mon Feb 17 21:38:04 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: all_sync_ops_linkable.c,v 1.1 2014/02/17 10:10:41 martin Exp $ */
+/* $NetBSD: all_sync_ops_linkable.c,v 1.2 2014/02/17 21:38:04 joerg Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@
 #ifdef __HAVE_ATOMIC64_OPS
        __sync_fetch_and_and_8(&u64, 0x80);
 #endif
+#ifndef __clang__
        __sync_fetch_and_nand(&u8, 0x80);
        __sync_fetch_and_nand_1(&u8, 0x80);
        __sync_fetch_and_nand_2(&u16, 0x80);
@@ -89,6 +90,7 @@
 #ifdef __HAVE_ATOMIC64_OPS
        __sync_fetch_and_nand_8(&u64, 0x80);
 #endif
+#endif
        __sync_fetch_and_or(&u8, 0x80);
        __sync_fetch_and_or_1(&u8, 0x80);
        __sync_fetch_and_or_2(&u16, 0x80);
@@ -124,6 +126,7 @@
 #ifdef __HAVE_ATOMIC64_OPS
        __sync_lock_test_and_set_8(&u64, 5);
 #endif
+#ifndef __clang__
        __sync_nand_and_fetch(&u8, 5);
        __sync_nand_and_fetch_1(&u8, 5);
        __sync_nand_and_fetch_2(&u16, 5);
@@ -131,6 +134,7 @@
 #ifdef __HAVE_ATOMIC64_OPS
        __sync_nand_and_fetch_8(&u64, 5);
 #endif
+#endif
        __sync_or_and_fetch(&u8, 5);
        __sync_or_and_fetch_1(&u8, 5);
        __sync_or_and_fetch_2(&u16, 5);



Home | Main Index | Thread Index | Old Index