Commit ba1e53f116

Andrew Kelley <andrew@ziglang.org>
2023-01-05 05:07:24
avoid triggering LLVM bug on MIPS
See #13782
1 parent 8248fdb
Changed files (2)
lib
std
test
behavior
lib/std/http/Client.zig
@@ -551,5 +551,12 @@ pub fn request(client: *Client, url: Url, headers: Request.Headers, options: Req
 }
 
 test {
+    const builtin = @import("builtin");
+    const native_endian = comptime builtin.cpu.arch.endian();
+    if (builtin.zig_backend == .stage2_llvm and native_endian == .Big) {
+        // https://github.com/ziglang/zig/issues/13782
+        return error.SkipZigTest;
+    }
+
     _ = Request;
 }
test/behavior/bitcast.zig
@@ -109,7 +109,7 @@ fn testBitCastuXToBytes(comptime N: usize) !void {
         const bytes = std.mem.asBytes(&x);
 
         const byte_count = (N + 7) / 8;
-        switch (builtin.cpu.arch.endian()) {
+        switch (native_endian) {
             .Little => {
                 var byte_i = 0;
                 while (byte_i < (byte_count - 1)) : (byte_i += 1) {
@@ -333,7 +333,7 @@ test "comptime @bitCast packed struct to int and back" {
     if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
     if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
 
-    if (comptime builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.endian() == .Big) {
+    if (builtin.zig_backend == .stage2_llvm and native_endian == .Big) {
         // https://github.com/ziglang/zig/issues/13782
         return error.SkipZigTest;
     }