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

#include <testfwk.h>

#include <stdint.h>

#if !defined(__SDCC_pdk14) // Lack of memory
unsigned short a = 41461;
unsigned short b = 3419;
#if __SIZEOF_INT__ >= 4
int c = 0;

void foo() {
  if (a + b * ~(0 != 5))
    c = -~(b * ~(0 != 5)) + 2147483647;
}
#else
int32_t c = 0;

void foo() {
  if (a + b * ~((int32_t)(0 != 5)))
    c = -~(b * ~((int32_t)(0 != 5))) + 2147483647;
}
#endif
#endif

void
testTortureExecute (void) {
#if !defined(__SDCC_pdk14) // Lack of memory
  foo();
  if (c != 2147476810)
    ASSERT (0);
  return;
#endif
}