Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.c-torture/execute/pr45695.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* PR rtl-optimization/45695 */ |
2 | |
3 extern void abort (void); | |
4 | |
5 __attribute__((noinline)) void | |
6 g (int x) | |
7 { | |
8 asm volatile ("" : "+r" (x)); | |
9 } | |
10 | |
11 __attribute__((noinline)) int | |
12 f (int a, int b, int d) | |
13 { | |
14 int r = -1; | |
15 b += d; | |
16 if (d == a) | |
17 r = b - d; | |
18 g (b); | |
19 return r; | |
20 } | |
21 | |
22 int | |
23 main (void) | |
24 { | |
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; | |
32 } |