1 /* Test endian.h endian-conversion macros work with -Wsign-conversion.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
29 /* This is a compilation test. */
30 u16
= (htobe16 (u16
));
31 u16
= (htole16 (u16
));
32 u16
= (be16toh (u16
));
33 u16
= (le16toh (u16
));
34 u32
= (htobe32 (u32
));
35 u32
= (htole32 (u32
));
36 u32
= (be32toh (u32
));
37 u32
= (le32toh (u32
));
38 u64
= (htobe64 (u64
));
39 u64
= (htole64 (u64
));
40 u64
= (be64toh (u64
));
41 u64
= (le64toh (u64
));
48 #include <support/test-driver.c>