| ... | ... | @@ -22,10 +22,14 @@ pub var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 22 | 22 | pub var log_level = std.log.Level.warn; |
| 23 | 23 | |
| 24 | 24 | fn print(comptime fmt: []const u8, args: anytype) void { |
| 25 | | // Disable printing in tests for simple backends. |
| 26 | | if (builtin.zig_backend == .stage2_spirv64) return; |
| 25 | if (@inComptime()) { |
| 26 | @compileError(std.fmt.comptimePrint(fmt, args)); |
| 27 | } else { |
| 28 | // Disable printing in tests for simple backends. |
| 29 | if (builtin.zig_backend == .stage2_spirv64) return; |
| 27 | 30 | |
| 28 | | std.debug.print(fmt, args); |
| 31 | std.debug.print(fmt, args); |
| 32 | } |
| 29 | 33 | } |
| 30 | 34 | |
| 31 | 35 | /// This function is intended to be used only in tests. It prints diagnostics to stderr |