summaryrefslogtreecommitdiff
path: root/tests/test-stdint.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-01-08 11:51:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-01-08 11:51:07 +0100
commitbe8efac78d067c138ad8dda03df4336e73f94887 (patch)
tree5f5254a628ba0ef72065b93d949d1c985742ea8e /tests/test-stdint.c
parent7b65dbd4ebade81d504cfe5e681292a58ad1fdf0 (diff)
New upstream version 1.0upstream/1.0
Diffstat (limited to 'tests/test-stdint.c')
-rw-r--r--tests/test-stdint.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/test-stdint.c b/tests/test-stdint.c
index 8a465578..fc5a7e93 100644
--- a/tests/test-stdint.c
+++ b/tests/test-stdint.c
@@ -1,5 +1,5 @@
/* Test of <stdint.h> substitute.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "verify.h"
#include "intprops.h"
-#if __GNUC__ >= 2 && DO_PEDANTIC
+#if ((__GNUC__ >= 2) || (__clang_major__ >= 4)) && DO_PEDANTIC
# define verify_same_types(expr1,expr2) \
extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
@@ -217,12 +217,14 @@ err or;
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
+verify (sizeof (void *) <= sizeof (intptr_t));
verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
uintptr_t h[2] = { 17, UINTPTR_MAX };
+verify (sizeof (void *) <= sizeof (uintptr_t));
verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
@@ -245,9 +247,10 @@ uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX };
verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0);
-/* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in
+/* Older Sun C and HP-UX 10.20 cc don't support 'long long' constants in
the preprocessor. */
-#if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__))
+#if !((defined __SUNPRO_C && __SUNPRO_C < 0x5150) \
+ || (defined __hpux && !defined __GNUC__))
#if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX
/* ok */
#else
@@ -361,7 +364,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
*/
#define verify_width(width, min, max) \
_GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \
- "verify_width check")
+ "verify_width check", -)
/* Macros specified by ISO/IEC TS 18661-1:2014. */