49028b030632a93f2cb93844f6a405ed60a26d46
1 /* Copyright (C) 2010 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* The original program corresponding to pieces.S.
19 This came from https://bugzilla.redhat.com/show_bug.cgi?id=589467
20 Note that it is not ever compiled, pieces.S is used instead.
21 However, it is used to extract breakpoint line numbers. */
23 struct A
{ int i
; int j
; };
24 struct B
{ int : 4; int i
: 12; int j
: 12; int : 4; };
26 __attribute__((noinline
)) void
29 asm volatile ("" : : "r" (x
) : "memory");
32 __attribute__((noinline
)) int
35 struct A a
= { 4, k
+ 6 };
36 asm ("" : "+r" (a
.i
));
38 bar (a
.i
); /* { dg-final { gdb-test 20 "a.i" "4" } } */
39 bar (a
.j
); /* { dg-final { gdb-test 20 "a.j" "14" } } */
40 return a
.i
+ a
.j
; /* f1 breakpoint */
43 __attribute__((noinline
)) int
46 int a
[2] = { 4, k
+ 6 };
47 asm ("" : "+r" (a
[0]));
49 bar (a
[0]); /* { dg-final { gdb-test 31 "a\[0\]" "4" } } */
50 bar (a
[1]); /* { dg-final { gdb-test 31 "a\[1\]" "14" } } */
51 return a
[0] + a
[1]; /* f2 breakpoint */
54 __attribute__((noinline
)) int
57 struct B a
= { 4, k
+ 6 };
58 asm ("" : "+r" (a
.i
));
60 bar (a
.i
); /* { dg-final { gdb-test 42 "a.i" "4" } } */
61 bar (a
.j
); /* { dg-final { gdb-test 42 "a.j" "14" } } */
62 return a
.i
+ a
.j
; /* f3 breakpoint */
65 __attribute__((noinline
)) int
69 asm ("" : "+r" (a
[0]));
73 return a
[0] + a
[1]; /* f4 breakpoint */
76 __attribute__((noinline
)) int
79 struct A a
= { k
, k
};
80 asm ("" : "+r" (a
.i
));
84 return a
.i
+ a
.j
; /* f5 breakpoint */
91 asm ("" : "=r" (k
) : "0" (7));
This page took 0.031282 seconds and 3 git commands to generate.