testing: fix str710 test case now builds
[openocd.git] / testing / examples / STR710Test / src / main.c
1 /****************************************************************************
2 * Copyright (c) 2006 by Michael Fischer. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the author nor the names of its contributors may
14 * be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 ****************************************************************************
31 * History:
32 *
33 * 30.03.06 mifi First Version for Insight tutorial
34 * 26.01.08 mifi Added variable "d" to test const variable.
35 ****************************************************************************/
36 #define __MAIN_C__
37
38 /*
39 * I use the include only, to show
40 * how to setup a include dir in the makefile
41 */
42 #include "typedefs.h"
43
44 /* Increase the size of this dummy global data to create a larger ROM image */
45 static const char test[] =
46 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
47 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
48 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
49 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
50 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
51 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
52 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
53 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"
54 "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa";
55
56
57
58 /*=========================================================================*/
59 /* DEFINE: All Structures and Common Constants */
60 /*=========================================================================*/
61
62 /*=========================================================================*/
63 /* DEFINE: Prototypes */
64 /*=========================================================================*/
65
66 /*=========================================================================*/
67 /* DEFINE: Definition of all local Data */
68 /*=========================================================================*/
69 static const DWORD d = 7;
70
71 /*=========================================================================*/
72 /* DEFINE: Definition of all local Procedures */
73 /*=========================================================================*/
74
75 /*=========================================================================*/
76 /* DEFINE: All code exported */
77 /*=========================================================================*/
78 /***************************************************************************/
79 /* main */
80 /***************************************************************************/
81 int main (void)
82 {
83 DWORD a = 1;
84 DWORD b = 2;
85 DWORD c = 0;
86
87 a = a + d;
88
89 while (1)
90 {
91 a++;
92 b++;
93 c = a + b;
94 }
95
96 /*
97 * This return here make no sense.
98 * But to prevent the compiler warning:
99 * "return type of 'main' is not 'int'
100 * we use an int as return :-)
101 */
102 return(0);
103 }
104
105 /*** EOF ***/