summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtin-bswap-5.c
blob: ccac9663334decf0eca760e6d33df97113398990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do run } */
/* { dg-options "-O" } */
int
main (void)
{
  /* Test constant folding.  */
  extern void link_error (void);

  if (__builtin_bswap32(0xaabbccdd) != 0xddccbbaa)
    link_error ();

  if (__builtin_bswap64(0x1122334455667788ULL) != 0x8877665544332211ULL)
    link_error ();

  return 0;
}