aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/inttypes-2.c
blob: 7ea63badc589d36a37bb53546bace0aaf4ab9d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* APPLE LOCAL file test of inttypes.h [U]INT*_C macros */

/* { dg-do compile } */
/* { dg-options "-Wall -W" } */

#include <stdio.h>
#include <inttypes.h>
#include <stdint.h>

#if INT8_C(3) != 3
#error int8 comparison failed
#endif

#if INT16_C(-3) != -3
#error int16 comparison failed
#endif

#if INT32_C(536870912) != 536870912L
#error int32 comparison failed
#endif

#if INT64_C(536870912) != 536870912LL
#error int64 comparison failed
#endif

#if UINT8_C(3) != 3
#error int8 comparison failed
#endif

#if UINT16_C(3) != 3
#error int16 comparison failed
#endif

#if UINT32_C(536870912) != 536870912UL
#error int32 comparison failed
#endif

#if UINT64_C(536870912) != 536870912ULL
#error int64 comparison failed
#endif

int main()
{
  return INT32_C(0);
}