1 /* PR debug/45882 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
4
5 extern void abort (void);
6 int a[1024];
7 volatile short int v;
8
9 __attribute__((noinline,noclone,used)) int
foo(int i,int j)10 foo (int i, int j)
11 {
12 int b = i; /* { dg-final { gdb-test 16 "b" "7" } } */
13 int c = i + 4; /* { dg-final { gdb-test 16 "c" "11" } } */
14 int d = a[i]; /* { dg-final { gdb-test 16 "d" "112" } } */
15 int e = a[i + 6]; /* { dg-final { gdb-test 16 "e" "142" } } */
16 ++v;
17 return ++j;
18 }
19
20 int
main(void)21 main (void)
22 {
23 int l;
24 asm ("" : "=r" (l) : "0" (7));
25 a[7] = 112;
26 a[7 + 6] = 142;
27 if (foo (l, 7) != 8)
28 abort ();
29 return l - 7;
30 }
31