summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr47391.c
blob: 5ec98f10850ced28aa13d2642c11e0ea45986a78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR tree-optimization/47391 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

const volatile int v = 1;
int i = 0;

void
foo (void)
{
  i = v;
}

int
main (void)
{
  foo ();
  return 0;
}

/* { dg-final { scan-tree-dump-not "i = 1;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */