╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ check_mingw.zig ──────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
63 } 64 break :pp result.stdout; 65 }; 66 67 const native = pp: { 68 var aw: Io.Writer.Allocating = .init(pp_arena); 69 errdefer aw.deinit(); 70 71 var pp: Preprocessor = .{ 72 .io = io, 73 .arena = pp_arena, 74 .include_dir = .initCwd(mingw_include_path), 75 .target = target, 76 }; 77 78 pp.preprocess(.initCwd(file_path)) catch |err| { 79 std.log.err("error preprocessing file {s} for target {t}: {t}", .{ entry.path, target.cpu.arch, err }); 80 fail = true; 81 continue; 82 }; 83 pp.prettyPrintTokens(&aw.writer) catch |err| { 84 std.log.err("error printing tokens for file {s} for target {t}: {t}", .{ entry.path, target.cpu.arch, err }); 85 fail = true; 86 continue; 87 }; 88 89 break :pp try aw.toOwnedSliceSentinel(0); 90 }; 91 92 try std.testing.expectEqualStrings(aro, native); 93 } 94 95 if (fail) std.process.exit(1); 96 } 97 } 98 99 const targets = [_]std.Target{ 100 .{ 101 .ofmt = .coff, 102 .abi = .gnu, 103 .os = .{ .tag = .windows, .version_range = .default(.thumb, .windows, .gnu) }, 104 .cpu = .{ .arch = .thumb, .model = .generic(.thumb), .features = .empty }, 105 }, 106 .{ 107 .ofmt = .coff, 108 .abi = .gnu, 109 .os = .{ .tag = .windows, .version_range = .default(.aarch64, .windows, .gnu) }, 110 .cpu = .{ .arch = .aarch64, .model = .generic(.aarch64), .features = .empty }, 111 }, 112 .{ 113 .ofmt = .coff, 114 .abi = .gnu, 115 .os = .{ .tag = .windows, .version_range = .default(.x86, .windows, .gnu) }, 116 .cpu = .{ .arch = .x86, .model = .generic(.x86), .features = .empty }, 117 }, 118 .{ 119 .ofmt = .coff, 120 .abi = .gnu, 121 .os = .{ .tag = .windows, .version_range = .default(.x86_64, .windows, .gnu) }, 122 .cpu = .{ .arch = .x86_64, .model = .generic(.x86_64), .features = .empty }, 123 }, 124 }; 125