Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / guality / sra-1.c
blobe779d7ac8ffbda0ee479b3690d7b253805d2ccdd
1 /* PR debug/43983 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
5 struct A { int i; int j; };
6 struct B { int : 4; int i : 12; int j : 12; int : 4; };
8 __attribute__((noinline)) void
9 bar (int x)
11 asm volatile ("" : : "r" (x) : "memory");
14 __attribute__((noinline)) int
15 f1 (int k)
17 struct A a = { 4, k + 6 };
18 asm ("" : "+r" (a.i));
19 a.j++;
20 bar (a.i); /* { dg-final { gdb-test 21 "a.i" "4" } } */
21 bar (a.j); /* { dg-final { gdb-test 21 "a.j" "14" } } */
22 return a.i + a.j;
25 __attribute__((noinline)) int
26 f2 (int k)
28 int a[2] = { 4, k + 6 };
29 asm ("" : "+r" (a[0]));
30 a[1]++;
31 bar (a[0]); /* { dg-final { gdb-test 32 "a\[0\]" "4" } } */
32 bar (a[1]); /* { dg-final { gdb-test 32 "a\[1\]" "14" } } */
33 return a[0] + a[1];
36 __attribute__((noinline)) int
37 f3 (int k)
39 struct B a = { 4, k + 6 };
40 asm ("" : "+r" (a.i));
41 a.j++;
42 bar (a.i); /* { dg-final { gdb-test 43 "a.i" "4" } } */
43 bar (a.j); /* { dg-final { gdb-test 43 "a.j" "14" } } */
44 return a.i + a.j;
47 int
48 main (void)
50 int k;
51 asm ("" : "=r" (k) : "0" (7));
52 f1 (k);
53 f2 (k);
54 f3 (k);
55 return 0;