summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-961122-1.c
blob: dd5daedee56338366b807430fdff1532ef019622 (plain) (blame)
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
/*
   961122-1.c from the execute part of the gcc torture suite.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

// TODO: Enable when sdcc supports long long in these ports!
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
long long acc;

void
addhi (short a)
{
  acc += (long long) a << 32;
}

void
subhi (short a)
{
  acc -= (long long) a << 32;
}
#endif

void
testTortureExecute (void)
{
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
  acc = 0xffff00000000ll;
  addhi (1);
  ASSERT (acc == 0x1000000000000ll);
  subhi (1);
  ASSERT (acc == 0xffff00000000ll);
  return;
#endif
}