Debian Codegraph @

gcc/testsuite/gcc.dg/pr114310.c

raw
1 /* PR target/114310 */
2 /* { dg-do run { target int128 } } */
3
4 volatile __attribute__((aligned (sizeof (__int128_t)))) __int128_t v = 10;
5
6 int
7 main ()
8 {
9 #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
10 if (__sync_val_compare_and_swap (&v, (__int128_t) 10, (__int128_t) 0) != 10)
11 __builtin_abort ();
12 if (__sync_val_compare_and_swap (&v, (__int128_t) 10, (__int128_t) 15) != 0)
13 __builtin_abort ();
14 if (__sync_val_compare_and_swap (&v, (__int128_t) 0, (__int128_t) 42) != 0)
15 __builtin_abort ();
16 if (__sync_val_compare_and_swap (&v, (__int128_t) 31, (__int128_t) 35) != 42)
17 __builtin_abort ();
18 #endif
19 return 0;
20 }