2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr70169.c
blob41381e721e6f3522862965d9e22539c5536c29c6
1 /* PR tree-optimization/70169 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-strict-aliasing -fno-tree-dce" } */
4 /* { dg-skip-if "Program and data reside in different address spaces" { "avr-*-*" } } */
6 int printf (const char *, ...);
8 void
9 foo ()
11 unsigned char *p = (unsigned char *) &printf;
12 for (;;)
13 (*p)++;
16 void
17 bar (int x)
19 unsigned char *p = (unsigned char *) &printf;
20 int i;
21 for (i = 0; i < x; i++)
22 (*p)++;
25 void
26 baz (int x, int y)
28 unsigned char *p = (unsigned char *) &&lab;
29 int i;
30 if (y)
32 for (i = 0; i < x; i++)
33 (*p)++;
35 else
37 lab:
38 asm volatile ("");
39 foo ();