aboutsummaryrefslogtreecommitdiff
path: root/tests/debug.c
blob: 2cad88f089bcb4fa271dd7e341968d894b0c6eef (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
#include <stdio.h>

char c = 'x';

void print_row(int length)
{
    for (int x=0; x<length; x++) {
        printf("%c", c);
    }
    printf("\n");
}

int main()
{
    volatile int i = 42;
    const char *text = "constant\n";
    int threshold = 7;

    // Wait for the debugger to get us out of this loop.
    while (i)
        ;

    printf("%s", text);
    for (int y=0; y < 10; y++) {
        print_row(y);
    }
}