# stage2: add support for integers in LLVM backend · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0008bef1e643c190a12e13d99a21d5af7ebdaa1b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0008bef1e643c190a12e13d99a21d5af7ebdaa1b

Requested commit: 0008bef1e643c190a12e13d99a21d5af7ebdaa1b

Commit: 0008bef1e643c190a12e13d99a21d5af7ebdaa1b

Tree: f525e9fa6d4bbf431ac047ebc068399f4843b322

Author: Timon Kruiper

Committer: Timon Kruiper

## Message

````
stage2: add support for integers in LLVM backend

Also adds support for simple operators, like add and subtract.
The intcast and bitcast instruction also have been implemented.

Linking with libc also works, so we can now generate working executables!

`zig build-exe example.zig -fLLVM -lc`:
```
fn add(a: i32, b: i32) i32 {
    return a + b;
}

export fn main() c_int {
    var a: i32 = -5;
    const x = add(a, 7);
    var y = add(2, 0);
    y -= x;
    return y;
}
```

````

## Parents

- [e095ebf31254bf5eeba9c07a2ad724e880626f01](https://git.cafe/gitcafe/zig/commit/e095ebf31254bf5eeba9c07a2ad724e880626f01?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0008bef1e643c190a12e13d99a21d5af7ebdaa1b?format=markdown)
