167117Sdfr/* This testcase is part of GDB, the GNU debugger.
267117Sdfr
367117Sdfr   Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
467117Sdfr
567117Sdfr   This program is free software; you can redistribute it and/or modify
667117Sdfr   it under the terms of the GNU General Public License as published by
767117Sdfr   the Free Software Foundation; either version 3 of the License, or
867117Sdfr   (at your option) any later version.
967117Sdfr
1067117Sdfr   This program is distributed in the hope that it will be useful,
1167117Sdfr   but WITHOUT ANY WARRANTY; without even the implied warranty of
1267117Sdfr   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1367117Sdfr   GNU General Public License for more details.
1467117Sdfr
1567117Sdfr   You should have received a copy of the GNU General Public License
1667117Sdfr   along with this program.  If not, see <http://www.gnu.org/licenses/>.
1767117Sdfr
1867117Sdfr   Please email any bugs, comments, and/or additions to this file to:
1967117Sdfr   bug-gdb@gnu.org  */
2067117Sdfr
2167117Sdfr/* This source is mainly to test what happens when a watchpoint is
2267117Sdfr   removed while another watchpoint, inserted later is left active.  */
2367117Sdfr
2467117Sdfrint count = -1;
2567117Sdfrint ival1 = -1;
2667117Sdfrint ival2 = -1;
2767117Sdfrint ival3 = -1;
28111777Sobrienint ival4 = -1;
2967117Sdfr
3067117Sdfrint
31134739Smarcelmain ()
32134739Smarcel{
33134739Smarcel#ifdef usestubs
34134739Smarcel  set_debug_traps();
35134739Smarcel  breakpoint();
3667117Sdfr#endif
37
38  for (count = 0; count < 4; count++) {
39    ival1 = count; ival2 = count;
40    ival3 = count; ival4 = count;
41  }
42
43  ival1 = count; ival2 = count;  /* Outside loop */
44  ival3 = count; ival4 = count;
45
46  return 0;
47}
48