summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-pr64718.c
blob: ac970ec72f3b3c70fe6b981c90bb7d2374bbfe21 (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
/*
   pr64718.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

static int
swap (int x)
{
  return (unsigned short) ((unsigned short) x << 8 | (unsigned short) x >> 8);
}

static int a = 0x1234;

void
testTortureExecute (void)
{
  int b = 0x1234;
  if (swap (a) != 0x3412)
    ASSERT (0);
  if (swap (b) != 0x3412)
    ASSERT (0);
  return;
}