Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/atomic Make the _and_and_ have-nots compile.



details:   https://anonhg.NetBSD.org/src/rev/f30cae1b20e6
branches:  trunk
changeset: 997217:f30cae1b20e6
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 27 15:32:11 2019 +0000

description:
Make the _and_and_ have-nots compile.

diffstat:

 tests/lib/libc/atomic/t___sync_and.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r f04cabafff26 -r f30cae1b20e6 tests/lib/libc/atomic/t___sync_and.c
--- a/tests/lib/libc/atomic/t___sync_and.c      Wed Feb 27 12:59:35 2019 +0000
+++ b/tests/lib/libc/atomic/t___sync_and.c      Wed Feb 27 15:32:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t___sync_and.c,v 1.1 2019/02/26 10:01:41 isaki Exp $   */
+/*     $NetBSD: t___sync_and.c,v 1.2 2019/02/27 15:32:11 christos Exp $        */
 
 /*
  * Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t___sync_and.c,v 1.1 2019/02/26 10:01:41 isaki Exp $");
+__RCSID("$NetBSD: t___sync_and.c,v 1.2 2019/02/27 15:32:11 christos Exp $");
 
 #include <atf-c.h>
 #include <inttypes.h>
@@ -54,6 +54,7 @@
 { \
        atf_tc_set_md_var(tc, "descr", #NAME); \
 } \
+extern TYPE NAME(volatile TYPE *, TYPE) __attribute__((__weak__)); \
 ATF_TC_BODY(NAME, tc) \
 { \
        volatile TYPE val; \
@@ -65,6 +66,8 @@
        src = (TYPE)SRC; \
        expval = (TYPE)EXPECT; \
        expres = (TYPE)DST; \
+       if (NAME == NULL) \
+               return; \
        res = NAME(&val, src); \
        ATF_REQUIRE_MSG(val == expval, \
            "val expects 0x%" FMT " but 0x%" FMT, expval, val); \
@@ -85,6 +88,7 @@
 { \
        atf_tc_set_md_var(tc, "descr", #NAME); \
 } \
+extern TYPE NAME(volatile TYPE *, TYPE) __attribute__((__weak__)); \
 ATF_TC_BODY(NAME, tc) \
 { \
        volatile TYPE val; \
@@ -94,6 +98,8 @@
        val = (TYPE)DST; \
        src = (TYPE)SRC; \
        exp = (TYPE)EXPECT; \
+       if (NAME == NULL) \
+               return; \
        res = NAME(&val, src); \
        ATF_REQUIRE_MSG(val == exp, \
            "val expects 0x%" FMT " but 0x%" FMT, exp, val); \



Home | Main Index | Thread Index | Old Index