Commit cb46d0b5b0
Changed files (3)
src/codegen.cpp
@@ -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) {
test/run_tests.cpp
@@ -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");
README.md
@@ -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