summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-pr79121.c
blob: 342f512b89f95d88e28562e9f13956fd2280fb6c (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
   pr79043.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#include <stdint.h>

#ifndef __SDCC_pdk14 // Lack of memory
unsigned long long f1 (int32_t x)
{
  return ((unsigned long long) x) << 4;
}

long long f2 (uint32_t x)
{
  return ((long long) x) << 4;
}

unsigned long long f3 (uint32_t x)
{
  return ((unsigned long long) x) << 4;
}

long long f4 (int32_t x)
{
  return ((long long) x) << 4;
}
#endif

void
testTortureExecute (void)
{
#ifndef __SDCC_pdk14 // Lack of memory
  if (f1 (0xf0000000) != 0xffffffff00000000)
    ASSERT (0);
  if (f2 (0xf0000000) != 0xf00000000)
    ASSERT (0);
  if (f3 (0xf0000000) != 0xf00000000)
    ASSERT (0);
  if (f4 (0xf0000000) != 0xffffffff00000000)
    ASSERT (0);
  return;
#endif
}