repos / gbc

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

gbc / tests
xplshn  ·  2025-08-13

globals.b

B
 1foo 0x0102030405060708;
 2
 3assert_equal(actual, expected, message) {
 4    extrn printf, abort;
 5    printf("%s: ", message);
 6    if (actual != expected) {
 7        printf("FAIL\n");
 8        abort();
 9    } else {
10        printf("OK\n");
11    }
12}
13
14main() {
15    extrn assert_equal;
16    assert_equal(foo, 0x0102030405060708, "foo == 0x0102030405060708");
17}