aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr68671.c
blob: 0950156181758afbb77533fe3aee0a162d093278 (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
/* PR tree-optimization/68671 */
/* { dg-do run } */
/* { dg-options " -O2 -fno-tree-dce" } */
/* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "*" } { "" } } */

volatile int a = -1;
volatile int b;

static inline int
fn1 (signed char p1, int p2)
{
  return (p1 < 0) || (p1 > (1 >> p2)) ? 0 : (p1 << 1);
}

int
main ()
{
  signed char c = a;
  b = fn1 (c, 1);
  c = ((128 | c) < 0 ? 1 : 0);
  if (c != 1)
    __builtin_abort ();
  return 0;
}