Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / i386-mpx-sigsegv.c
CommitLineData
88b9d363 1/* Copyright (C) 2015-2022 Free Software Foundation, Inc.
012b3a21
WT
2
3 Contributed by Intel Corp. <walfred.tedeschi@intel.com>
4
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.
9
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.
14
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/>. */
17
012b3a21
WT
18#define OUR_SIZE 5
19
20int gx[OUR_SIZE];
21int ga[OUR_SIZE];
22int gb[OUR_SIZE];
23int gc[OUR_SIZE];
24int gd[OUR_SIZE];
25
012b3a21
WT
26int
27bp1 (int value)
28{
29 return 1;
30}
31
32int
33bp2 (int value)
34{
35 return 1;
36}
37
38void
39upper (int * p, int * a, int * b, int * c, int * d, int len)
40{
41 int value;
42 value = *(p + len);
43 value = *(a + len);
44 value = *(b + len);
45 value = *(c + len);
46 value = *(d + len);
47}
48
49void
50lower (int * p, int * a, int * b, int * c, int * d, int len)
51{
52 int value;
53 value = *(p - len);
54 value = *(a - len);
55 value = *(b - len);
56 value = *(c - len);
57 bp2 (value);
58 value = *(d - len);
59}
60
61int
62main (void)
63{
3f94e588
TV
64 int sx[OUR_SIZE];
65 int sa[OUR_SIZE];
66 int sb[OUR_SIZE];
67 int sc[OUR_SIZE];
68 int sd[OUR_SIZE];
69 int *x, *a, *b, *c, *d;
70
71 x = calloc (OUR_SIZE, sizeof (int));
72 a = calloc (OUR_SIZE, sizeof (int));
73 b = calloc (OUR_SIZE, sizeof (int));
74 c = calloc (OUR_SIZE, sizeof (int));
75 d = calloc (OUR_SIZE, sizeof (int));
76
77 upper (x, a, b, c, d, OUR_SIZE + 2);
78 upper (sx, sa, sb, sc, sd, OUR_SIZE + 2);
79 upper (gx, ga, gb, gc, gd, OUR_SIZE + 2);
80 lower (x, a, b, c, d, 1);
81 lower (sx, sa, sb, sc, sd, 1);
82 bp1 (*x);
83 lower (gx, ga, gb, gc, gd, 1);
84
85 free (x);
86 free (a);
87 free (b);
88 free (c);
89 free (d);
012b3a21 90
012b3a21
WT
91 return 0;
92}
This page took 0.901009 seconds and 4 git commands to generate.