summaryrefslogtreecommitdiff
path: root/tools/splat/test/basic_app/main.c
blob: cf119f7c19ba0ba0af06bf7a9fa80e008bbdf169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// .data
volatile int test = 1;

// bin (.rodata)
const char bin_data[] = {0,1,2,3,4,5,6,7};

// .bss
unsigned long long bss_data[0x10];

// .data
volatile int switch_arg = 0;

int do_switch()
{
    switch(switch_arg)
    {
        case 0:
        return 7;
        case 1:
        return 6;
        case 2:
        return 5;
        case 3:
        return 4;
        case 4:
        return 3;
        case 5:
        return 2;
        case 6:
        return 1;
        case 7:
        return 0; 
    }
    return 0;
}

// c
void bootproc()
{
    do_switch();
    for (;;)
    {
        test++;
    }
}