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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* PR middle-end/37931 */


int
foo (int a, unsigned int b)
{
  return (a | 1) & (b | 1);
}

void
testTortureExecute (void)
{
  if (foo (6, 0xc6) != 7)
    ASSERT (0);
  if (foo (0x80, 0xc1) != 0x81)
    ASSERT (0);
  if (foo (4, 4) != 5)
    ASSERT (0);
  if (foo (5, 4) != 5)
    ASSERT (0);
  return;
}