PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr45695.c
blobeb1e4c788ab35d7321f517403b967bd7d188f096
1 /* PR rtl-optimization/45695 */
3 extern void abort (void);
5 __attribute__((noinline)) void
6 g (int x)
8 asm volatile ("" : "+r" (x));
11 __attribute__((noinline)) int
12 f (int a, int b, int d)
14 int r = -1;
15 b += d;
16 if (d == a)
17 r = b - d;
18 g (b);
19 return r;
22 int
23 main (void)
25 int l;
26 asm ("" : "=r" (l) : "0" (0));
27 if (f (l + 0, l + 1, l + 4) != -1)
28 abort ();
29 if (f (l + 4, l + 1, l + 4) != 1)
30 abort ();
31 return 0;