Files
ground-rewrite/test/test.c

16 lines
718 B
C
Raw Normal View History

2026-06-15 20:27:50 +10:00
#include <ground.h>
int main() {
GroundProgram program = Ground.New.Program();
printf(Ground.Flags.error ? "true\n" : "false\n");
GroundState state = {NULL, NULL, NULL};
GroundInstruction instruction = Ground.New.Instruction(GroundInstruction_ADD);
printf(Ground.Flags.error ? "true\n" : "false\n");
Ground.Instruction.append(&instruction, Ground.New.Arg.Value(Ground.New.Value.Int(2)));
printf(Ground.Flags.error ? "true\n" : "false\n");
Ground.Instruction.append(&instruction, Ground.New.Arg.Value(Ground.New.Value.Int(2)));
printf(Ground.Flags.error ? "true\n" : "false\n");
Ground.Program.execute(&program, &state);
printf(Ground.Flags.error ? "true\n" : "false\n");
}