fix codegen for pointers to void

This commit is contained in:
Andrew Kelley
2016-01-27 14:18:20 -07:00
parent 261517aa44
commit 707154da36
4 changed files with 208 additions and 129 deletions

View File

@@ -1316,6 +1316,19 @@ pub fn main(args: [][]u8) -> %void {
%%stdout.printf("BAD\n");
}
%%stdout.printf("OK\n");
}
)SOURCE", "OK\n");
add_simple_case("pointer to void return type", R"SOURCE(
import "std.zig";
const x = void{};
fn f() -> &void {
%%stdout.printf("OK\n");
return &x;
}
pub fn main(args: [][]u8) -> %void {
const a = f();
return *a;
}
)SOURCE", "OK\n");
}