From be8efac78d067c138ad8dda03df4336e73f94887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Jan 2022 11:51:07 +0100 Subject: New upstream version 1.0 --- tests/test-stdint.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/test-stdint.c') diff --git a/tests/test-stdint.c b/tests/test-stdint.c index 8a46557..fc5a7e9 100644 --- a/tests/test-stdint.c +++ b/tests/test-stdint.c @@ -1,5 +1,5 @@ /* Test of 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. */ -- cgit v1.2.3