| 1 | export fn foo() void { |
| 2 | comptime bar(12, "hi"); |
| 3 | _ = &bar; |
| 4 | } |
| 5 | fn bar(a: i32, b: []const u8) void { |
| 6 | @compileLog("begin"); |
| 7 | @compileLog("a", a, "b", b); |
| 8 | @compileLog("end"); |
| 9 | } |
| 10 | export fn baz() void { |
| 11 | const S = struct { a: u32 }; |
| 12 | @compileLog(@sizeOf(S)); |
| 13 | } |
| 14 | |
| 15 | // error |
| 16 | // |
| 17 | // :6:5: error: found compile log statement |
| 18 | // :6:5: note: also here |
| 19 | // :12:5: note: also here |
| 20 | // |
| 21 | // Compile Log Output: |
| 22 | // @as(*const [5:0]u8, "begin") |
| 23 | // @as(*const [1:0]u8, "a"), @as(i32, 12), @as(*const [1:0]u8, "b"), @as([]const u8, "hi"[0..2]) |
| 24 | // @as(*const [3:0]u8, "end") |
| 25 | // @as(*const [5:0]u8, "begin") |
| 26 | // @as(*const [1:0]u8, "a"), @as(i32, [runtime value]), @as(*const [1:0]u8, "b"), @as([]const u8, [runtime value]) |
| 27 | // @as(*const [3:0]u8, "end") |
| 28 | // @as(comptime_int, 4) |