* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / c-c++-common / int128-1.c
blobdafb2a9934996fb3e9516c07905c29c54a57e8d8
1 /* { dg-do run { target int128 } } */
2 /* { dg-options "-std=gnu99" { target c } } */
3 /* { dg-options "" { target c++ } } */
5 #include <stdarg.h>
7 #ifndef __cplusplus
8 extern void abort (void);
9 #else
10 extern "C" void abort (void);
11 #endif
13 #define MK_CONST128(A,B,C,D) \
14 ( (((unsigned __int128) (unsigned int) A) << 96) \
15 | (((unsigned __int128) (unsigned int) B) << 64) \
16 | (((unsigned __int128) (unsigned int) C) << 32) \
17 | ((unsigned __int128) (unsigned int) D) )
19 #define MK_CONST128_SIGNED(A,B,C,D) \
20 ((__int128) MK_CONST128(A, B, C, D))
22 void foo(int i, ...)
24 __int128 q;
25 va_list va;
27 va_start(va, i);
28 q = va_arg(va, __int128);
29 va_end(va);
31 if (q != MK_CONST128_SIGNED (0xfeffffffU, 2U, 3U, 4U))
32 abort();
35 int main(void)
37 __int128 q = MK_CONST128_SIGNED (0xfeffffffU, 2U, 3U, 4U);
39 foo(1, q);
40 return 0;