summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr16693-2.C
blob: cb60df64264bf449567b838523f79a3fc35a1f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR middle-end/16693
// { dg-do run }
// { dg-options "-O2" }

extern "C" void abort();

char foo()
{
  return 0x10;
}

enum E { e = 0x0f };

int main()
{
  char c = (char)(E)(e & foo());
  if (c != 0)
    abort();
  return 0;
}