summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/expect1.C
blob: 90a871f377ade50353a7321da4e18855b5623a3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/13239
// { dg-do run }
// { dg-options "-O2" }

extern "C" void abort (void);

struct Y {
  int i;
};

bool foo () { return true; }
Y bar () { Y y = {0}; return y; }

int main ()
{
  __builtin_expect (foo () && (bar ().i) == 0, 0) ? 0 : (abort (), 1);
}