repos / gbc

GBC - Go B Compiler
git clone https://github.com/xplshn/gbc.git

gbc / tests
xplshn  ·  2025-08-13

upper.b

B
 1// Testing char() and lchar()
 2main() {
 3    extrn char, printf, malloc, strlen, lchar, toupper;
 4    auto s, q, i, n;
 5    s = "hello, world";
 6    printf("lower: %s\n", s);
 7    n = strlen(s);
 8    q = malloc(n + 1);
 9    i = 0; while (i < n) {
10        lchar(q, i, toupper(char(s, i)));
11        i++;
12    }
13    lchar(q, n, 0);
14    printf("UPPER: %s\n", q);
15}