OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [testsuite/] [gdb.base/] [display.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* Loop and vars for tests of display commands
2
*/
3
#include <stdio.h>
4
#define LOOP 10
5
 
6
int sum = 0;
7
 
8
int do_loops()
9
{
10
    int i=0;
11
    int k=0;
12
    int j=0;
13
 
14
    for( i = 0; i < LOOP; i++ ) {
15
        for( j = 0; j < LOOP; j++ ) {
16
            for( k = 0; k < LOOP; k++ ) {
17
                sum++;
18
            }
19
        }
20
    }
21
    return i;
22
}
23
 
24
int do_vars()
25
{
26
    int       j;
27
    int       i = 9;
28
    float     f = 1.234;
29
    char      c = 'Q';
30
    int    *p_i = &i;
31
    float  *p_f = &f;
32
    char   *p_c = "rubarb and fries";
33
 
34
    /* Need some code here to set breaks on.
35
     */
36
    for( j = 0; j < LOOP; j++ ) {
37
        if( p_c[j] == c ) {
38
            j++;
39
        }
40
        else {
41
            i++;
42
        }
43
    }
44
 
45
    return *p_i;
46
}
47
 
48
main()
49
{
50
    do_loops();
51
    do_vars();
52
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.