aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/cond2.C
blob: d9f1d59a3be04f4718c950d829284bc7254831ed (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
// PR c++/70744
// { dg-do run }
// { dg-options "" }

static void
fn1 (void)
{
  int x = 2;
  ++x ? : 42;
  if (x != 3)
    __builtin_abort ();
  --x ? : 42;
  if (x != 2)
    __builtin_abort ();
  x++ ? : 42;
  if (x != 3)
    __builtin_abort ();
  x-- ? : 42;
  if (x != 2)
    __builtin_abort ();
}

int
main ()
{
  fn1 ();
  return 0;
}