mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
fix not adding builtin functions code
This commit is contained in:
parent
ccc8e9f4c3
commit
cb46d0b5b0
3 changed files with 10 additions and 20 deletions
|
|
@ -45,10 +45,10 @@ compromises backward compatibility.
|
|||
### Current Status
|
||||
|
||||
* Have a look in the examples/ folder to see some code examples.
|
||||
* Some language features available such as loops, inline assembly, expressions,
|
||||
literals, functions, importing other files.
|
||||
* Only Linux x86_64 is supported.
|
||||
* Only building for the native target is supported.
|
||||
* Basic language features available such as loops, inline assembly,
|
||||
expressions, literals, functions, importing, structs, enums.
|
||||
* Linux x86_64 is supported.
|
||||
* Building for the native target is supported.
|
||||
* Optimized machine code that Zig produces is indistinguishable from
|
||||
optimized machine code produced from equivalent C program.
|
||||
* Zig can generate dynamic libraries, executables, object files, and C
|
||||
|
|
|
|||
|
|
@ -2748,8 +2748,7 @@ void codegen_add_root_code(CodeGen *g, Buf *src_dir, Buf *src_basename, Buf *sou
|
|||
g->bootstrap_import = add_special_code(g, "bootstrap.zig");
|
||||
}
|
||||
|
||||
// TODO re-enable this
|
||||
//add_special_code(g, "builtin.zig");
|
||||
add_special_code(g, "builtin.zig");
|
||||
}
|
||||
|
||||
if (g->verbose) {
|
||||
|
|
|
|||
|
|
@ -1033,19 +1033,6 @@ fn print_ok(val: #typeof(x)) -> #typeof(foo) {
|
|||
const foo : i32 = 0;
|
||||
)SOURCE", "OK\n");
|
||||
|
||||
add_simple_case("enum with void types", R"SOURCE(
|
||||
use "std.zig";
|
||||
enum Foo { A, B, C, D, }
|
||||
pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
|
||||
const foo : Foo = Foo.B;
|
||||
if (foo != Foo.B) {
|
||||
print_str("BAD\n");
|
||||
}
|
||||
print_str("OK\n");
|
||||
return 0;
|
||||
}
|
||||
)SOURCE", "OK\n");
|
||||
|
||||
add_simple_case("enum type", R"SOURCE(
|
||||
use "std.zig";
|
||||
|
||||
|
|
@ -1070,7 +1057,11 @@ enum Bar {
|
|||
pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
|
||||
const foo1 = Foo.One(13);
|
||||
const foo2 = Foo.Two(Point { .x = 1234, .y = 5678, });
|
||||
const bar = Bar.A;
|
||||
const bar = Bar.B;
|
||||
|
||||
if (bar != Bar.B) {
|
||||
print_str("BAD\n");
|
||||
}
|
||||
|
||||
if (#value_count(Foo) != 3) {
|
||||
print_str("BAD\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue