| ... | ... | @@ -168,6 +168,15 @@ fn printOutput( |
| 168 | 168 | try build_args.appendSlice(&[_][]const u8{ "-target", triple }); |
| 169 | 169 | try shell_out.print("-target {s} ", .{triple}); |
| 170 | 170 | } |
| 171 | if (code.use_llvm) |use_llvm| { |
| 172 | if (use_llvm) { |
| 173 | try build_args.append("-fllvm"); |
| 174 | try shell_out.print("-fllvm", .{}); |
| 175 | } else { |
| 176 | try build_args.append("-fno-llvm"); |
| 177 | try shell_out.print("-fno-llvm", .{}); |
| 178 | } |
| 179 | } |
| 171 | 180 | if (code.verbose_cimport) { |
| 172 | 181 | try build_args.append("--verbose-cimport"); |
| 173 | 182 | try shell_out.print("--verbose-cimport ", .{}); |
| ... | ... | @@ -224,7 +233,6 @@ fn printOutput( |
| 224 | 233 | break :code_block; |
| 225 | 234 | } |
| 226 | 235 | } |
| 227 | | |
| 228 | 236 | const target_query = try std.Target.Query.parse(.{ |
| 229 | 237 | .arch_os_abi = code.target_str orelse "native", |
| 230 | 238 | }); |
| ... | ... | @@ -319,6 +327,16 @@ fn printOutput( |
| 319 | 327 | }, |
| 320 | 328 | } |
| 321 | 329 | } |
| 330 | if (code.use_llvm) |use_llvm| { |
| 331 | if (use_llvm) { |
| 332 | try test_args.append("-fllvm"); |
| 333 | try shell_out.print("-fllvm", .{}); |
| 334 | } else { |
| 335 | try test_args.append("-fno-llvm"); |
| 336 | try shell_out.print("-fno-llvm", .{}); |
| 337 | } |
| 338 | } |
| 339 | |
| 322 | 340 | const result = run(arena, &env_map, tmp_dir_path, test_args.items) catch |
| 323 | 341 | fatal("test failed", .{}); |
| 324 | 342 | const escaped_stderr = try escapeHtml(arena, result.stderr); |
| ... | ... | @@ -469,6 +487,15 @@ fn printOutput( |
| 469 | 487 | try build_args.appendSlice(&[_][]const u8{ "-target", triple }); |
| 470 | 488 | try shell_out.print("-target {s} ", .{triple}); |
| 471 | 489 | } |
| 490 | if (code.use_llvm) |use_llvm| { |
| 491 | if (use_llvm) { |
| 492 | try build_args.append("-fllvm"); |
| 493 | try shell_out.print("-fllvm", .{}); |
| 494 | } else { |
| 495 | try build_args.append("-fno-llvm"); |
| 496 | try shell_out.print("-fno-llvm", .{}); |
| 497 | } |
| 498 | } |
| 472 | 499 | for (code.additional_options) |option| { |
| 473 | 500 | try build_args.append(option); |
| 474 | 501 | try shell_out.print("{s} ", .{option}); |
| ... | ... | @@ -538,6 +565,15 @@ fn printOutput( |
| 538 | 565 | try test_args.appendSlice(&[_][]const u8{ "-target", triple }); |
| 539 | 566 | try shell_out.print("-target {s} ", .{triple}); |
| 540 | 567 | } |
| 568 | if (code.use_llvm) |use_llvm| { |
| 569 | if (use_llvm) { |
| 570 | try test_args.append("-fllvm"); |
| 571 | try shell_out.print("-fllvm", .{}); |
| 572 | } else { |
| 573 | try test_args.append("-fno-llvm"); |
| 574 | try shell_out.print("-fno-llvm", .{}); |
| 575 | } |
| 576 | } |
| 541 | 577 | if (code.link_mode) |link_mode| { |
| 542 | 578 | switch (link_mode) { |
| 543 | 579 | .static => { |
| ... | ... | @@ -827,6 +863,7 @@ const Code = struct { |
| 827 | 863 | verbose_cimport: bool, |
| 828 | 864 | just_check_syntax: bool, |
| 829 | 865 | additional_options: []const []const u8, |
| 866 | use_llvm: ?bool, |
| 830 | 867 | |
| 831 | 868 | const Id = union(enum) { |
| 832 | 869 | @"test", |
| ... | ... | @@ -886,6 +923,7 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code { |
| 886 | 923 | var link_libc = false; |
| 887 | 924 | var disable_cache = false; |
| 888 | 925 | var verbose_cimport = false; |
| 926 | var use_llvm: ?bool = null; |
| 889 | 927 | |
| 890 | 928 | while (it.next()) |prefixed_line| { |
| 891 | 929 | const line = skipPrefix(prefixed_line); |
| ... | ... | @@ -901,6 +939,10 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code { |
| 901 | 939 | try additional_options.append(arena, line["additional_option=".len..]); |
| 902 | 940 | } else if (mem.startsWith(u8, line, "target=")) { |
| 903 | 941 | target_str = line["target=".len..]; |
| 942 | } else if (mem.eql(u8, line, "llvm=true")) { |
| 943 | use_llvm = true; |
| 944 | } else if (mem.eql(u8, line, "llvm=false")) { |
| 945 | use_llvm = false; |
| 904 | 946 | } else if (mem.eql(u8, line, "link_libc")) { |
| 905 | 947 | link_libc = true; |
| 906 | 948 | } else if (mem.eql(u8, line, "disable_cache")) { |
| ... | ... | @@ -923,6 +965,7 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code { |
| 923 | 965 | .disable_cache = disable_cache, |
| 924 | 966 | .verbose_cimport = verbose_cimport, |
| 925 | 967 | .just_check_syntax = just_check_syntax, |
| 968 | .use_llvm = use_llvm, |
| 926 | 969 | }; |
| 927 | 970 | } |
| 928 | 971 | |