zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

test_compileLog_builtin.zig (326B) - Raw


      1 const print = @import("std").debug.print;
      2 
      3 const num1 = blk: {
      4     var val1: i32 = 99;
      5     @compileLog("comptime val1 = ", val1);
      6     val1 = val1 + 1;
      7     break :blk val1;
      8 };
      9 
     10 test "main" {
     11     @compileLog("comptime in main");
     12 
     13     print("Runtime in main, num1 = {}.\n", .{num1});
     14 }
     15 
     16 // test_error=found compile log statement