| author | |
| committer | |
| log | 90f08a69aaf8b5d6c36faa92d605afcd5fde0002 |
| tree | 18a320927655ba151a658a7003693a825dde96f1 |
| parent | 3ea113e00887638bf8bfb1d00bae5649db7ded35 |
This also adds some float-related instructions to MIR/Emit27 files changed, 205 insertions(+), 35 deletions(-)
src/arch/wasm/Emit.zig+28| ... | @@ -153,6 +153,34 @@ pub fn emitMir(emit: *Emit) InnerError!void { | ... | @@ -153,6 +153,34 @@ pub fn emitMir(emit: *Emit) InnerError!void { |
| 153 | .i64_shl => try emit.emitTag(tag), | 153 | .i64_shl => try emit.emitTag(tag), |
| 154 | .i64_shr_s => try emit.emitTag(tag), | 154 | .i64_shr_s => try emit.emitTag(tag), |
| 155 | .i64_shr_u => try emit.emitTag(tag), | 155 | .i64_shr_u => try emit.emitTag(tag), |
| 156 | .f32_abs => try emit.emitTag(tag), | ||
| 157 | .f32_neg => try emit.emitTag(tag), | ||
| 158 | .f32_ceil => try emit.emitTag(tag), | ||
| 159 | .f32_floor => try emit.emitTag(tag), | ||
| 160 | .f32_trunc => try emit.emitTag(tag), | ||
| 161 | .f32_nearest => try emit.emitTag(tag), | ||
| 162 | .f32_sqrt => try emit.emitTag(tag), | ||
| 163 | .f32_add => try emit.emitTag(tag), | ||
| 164 | .f32_sub => try emit.emitTag(tag), | ||
| 165 | .f32_mul => try emit.emitTag(tag), | ||
| 166 | .f32_div => try emit.emitTag(tag), | ||
| 167 | .f32_min => try emit.emitTag(tag), | ||
| 168 | .f32_max => try emit.emitTag(tag), | ||
| 169 | .f32_copysign => try emit.emitTag(tag), | ||
| 170 | .f64_abs => try emit.emitTag(tag), | ||
| 171 | .f64_neg => try emit.emitTag(tag), | ||
| 172 | .f64_ceil => try emit.emitTag(tag), | ||
| 173 | .f64_floor => try emit.emitTag(tag), | ||
| 174 | .f64_trunc => try emit.emitTag(tag), | ||
| 175 | .f64_nearest => try emit.emitTag(tag), | ||
| 176 | .f64_sqrt => try emit.emitTag(tag), | ||
| 177 | .f64_add => try emit.emitTag(tag), | ||
| 178 | .f64_sub => try emit.emitTag(tag), | ||
| 179 | .f64_mul => try emit.emitTag(tag), | ||
| 180 | .f64_div => try emit.emitTag(tag), | ||
| 181 | .f64_min => try emit.emitTag(tag), | ||
| 182 | .f64_max => try emit.emitTag(tag), | ||
| 183 | .f64_copysign => try emit.emitTag(tag), | ||
| 156 | .i32_wrap_i64 => try emit.emitTag(tag), | 184 | .i32_wrap_i64 => try emit.emitTag(tag), |
| 157 | .i64_extend_i32_s => try emit.emitTag(tag), | 185 | .i64_extend_i32_s => try emit.emitTag(tag), |
| 158 | .i64_extend_i32_u => try emit.emitTag(tag), | 186 | .i64_extend_i32_u => try emit.emitTag(tag), |
src/arch/wasm/Mir.zig+56| ... | @@ -369,6 +369,62 @@ pub const Inst = struct { | ... | @@ -369,6 +369,62 @@ pub const Inst = struct { |
| 369 | /// Uses `tag` | 369 | /// Uses `tag` |
| 370 | i64_shr_u = 0x88, | 370 | i64_shr_u = 0x88, |
| 371 | /// Uses `tag` | 371 | /// Uses `tag` |
| 372 | f32_abs = 0x8B, | ||
| 373 | /// Uses `tag` | ||
| 374 | f32_neg = 0x8C, | ||
| 375 | /// Uses `tag` | ||
| 376 | f32_ceil = 0x8D, | ||
| 377 | /// Uses `tag` | ||
| 378 | f32_floor = 0x8E, | ||
| 379 | /// Uses `tag` | ||
| 380 | f32_trunc = 0x8F, | ||
| 381 | /// Uses `tag` | ||
| 382 | f32_nearest = 0x90, | ||
| 383 | /// Uses `tag` | ||
| 384 | f32_sqrt = 0x91, | ||
| 385 | /// Uses `tag` | ||
| 386 | f32_add = 0x92, | ||
| 387 | /// Uses `tag` | ||
| 388 | f32_sub = 0x93, | ||
| 389 | /// Uses `tag` | ||
| 390 | f32_mul = 0x94, | ||
| 391 | /// Uses `tag` | ||
| 392 | f32_div = 0x95, | ||
| 393 | /// Uses `tag` | ||
| 394 | f32_min = 0x96, | ||
| 395 | /// Uses `tag` | ||
| 396 | f32_max = 0x97, | ||
| 397 | /// Uses `tag` | ||
| 398 | f32_copysign = 0x98, | ||
| 399 | /// Uses `tag` | ||
| 400 | f64_abs = 0x99, | ||
| 401 | /// Uses `tag` | ||
| 402 | f64_neg = 0x9A, | ||
| 403 | /// Uses `tag` | ||
| 404 | f64_ceil = 0x9B, | ||
| 405 | /// Uses `tag` | ||
| 406 | f64_floor = 0x9C, | ||
| 407 | /// Uses `tag` | ||
| 408 | f64_trunc = 0x9D, | ||
| 409 | /// Uses `tag` | ||
| 410 | f64_nearest = 0x9E, | ||
| 411 | /// Uses `tag` | ||
| 412 | f64_sqrt = 0x9F, | ||
| 413 | /// Uses `tag` | ||
| 414 | f64_add = 0xA0, | ||
| 415 | /// Uses `tag` | ||
| 416 | f64_sub = 0xA1, | ||
| 417 | /// Uses `tag` | ||
| 418 | f64_mul = 0xA2, | ||
| 419 | /// Uses `tag` | ||
| 420 | f64_div = 0xA3, | ||
| 421 | /// Uses `tag` | ||
| 422 | f64_min = 0xA4, | ||
| 423 | /// Uses `tag` | ||
| 424 | f64_max = 0xA5, | ||
| 425 | /// Uses `tag` | ||
| 426 | f64_copysign = 0xA6, | ||
| 427 | /// Uses `tag` | ||
| 372 | i32_wrap_i64 = 0xA7, | 428 | i32_wrap_i64 = 0xA7, |
| 373 | /// Uses `tag` | 429 | /// Uses `tag` |
| 374 | i32_trunc_f32_s = 0xA8, | 430 | i32_trunc_f32_s = 0xA8, |
test/behavior.zig+21-21| ... | @@ -18,14 +18,19 @@ test { | ... | @@ -18,14 +18,19 @@ test { |
| 18 | _ = @import("behavior/bugs/679.zig"); | 18 | _ = @import("behavior/bugs/679.zig"); |
| 19 | _ = @import("behavior/bugs/704.zig"); | 19 | _ = @import("behavior/bugs/704.zig"); |
| 20 | _ = @import("behavior/bugs/718.zig"); | 20 | _ = @import("behavior/bugs/718.zig"); |
| 21 | _ = @import("behavior/bugs/726.zig"); | ||
| 22 | _ = @import("behavior/bugs/828.zig"); | ||
| 21 | _ = @import("behavior/bugs/1025.zig"); | 23 | _ = @import("behavior/bugs/1025.zig"); |
| 22 | _ = @import("behavior/bugs/1076.zig"); | 24 | _ = @import("behavior/bugs/1076.zig"); |
| 23 | _ = @import("behavior/bugs/1111.zig"); | 25 | _ = @import("behavior/bugs/1111.zig"); |
| 24 | _ = @import("behavior/bugs/1277.zig"); | 26 | _ = @import("behavior/bugs/1277.zig"); |
| 25 | _ = @import("behavior/bugs/1310.zig"); | 27 | _ = @import("behavior/bugs/1310.zig"); |
| 26 | _ = @import("behavior/bugs/1381.zig"); | 28 | _ = @import("behavior/bugs/1381.zig"); |
| 29 | _ = @import("behavior/bugs/1421.zig"); | ||
| 30 | _ = @import("behavior/bugs/1442.zig"); | ||
| 27 | _ = @import("behavior/bugs/1486.zig"); | 31 | _ = @import("behavior/bugs/1486.zig"); |
| 28 | _ = @import("behavior/bugs/1500.zig"); | 32 | _ = @import("behavior/bugs/1500.zig"); |
| 33 | _ = @import("behavior/bugs/1607.zig"); | ||
| 29 | _ = @import("behavior/bugs/1735.zig"); | 34 | _ = @import("behavior/bugs/1735.zig"); |
| 30 | _ = @import("behavior/bugs/1741.zig"); | 35 | _ = @import("behavior/bugs/1741.zig"); |
| 31 | _ = @import("behavior/bugs/1914.zig"); | 36 | _ = @import("behavior/bugs/1914.zig"); |
| ... | @@ -38,25 +43,34 @@ test { | ... | @@ -38,25 +43,34 @@ test { |
| 38 | _ = @import("behavior/bugs/3046.zig"); | 43 | _ = @import("behavior/bugs/3046.zig"); |
| 39 | _ = @import("behavior/bugs/3112.zig"); | 44 | _ = @import("behavior/bugs/3112.zig"); |
| 40 | _ = @import("behavior/bugs/3367.zig"); | 45 | _ = @import("behavior/bugs/3367.zig"); |
| 46 | _ = @import("behavior/bugs/3384.zig"); | ||
| 41 | _ = @import("behavior/bugs/3586.zig"); | 47 | _ = @import("behavior/bugs/3586.zig"); |
| 48 | _ = @import("behavior/bugs/3742.zig"); | ||
| 42 | _ = @import("behavior/bugs/4328.zig"); | 49 | _ = @import("behavior/bugs/4328.zig"); |
| 43 | _ = @import("behavior/bugs/4560.zig"); | 50 | _ = @import("behavior/bugs/4560.zig"); |
| 44 | _ = @import("behavior/bugs/4769_a.zig"); | 51 | _ = @import("behavior/bugs/4769_a.zig"); |
| 45 | _ = @import("behavior/bugs/4769_b.zig"); | 52 | _ = @import("behavior/bugs/4769_b.zig"); |
| 46 | _ = @import("behavior/bugs/4954.zig"); | 53 | _ = @import("behavior/bugs/4954.zig"); |
| 54 | _ = @import("behavior/bugs/5398.zig"); | ||
| 55 | _ = @import("behavior/bugs/5413.zig"); | ||
| 56 | _ = @import("behavior/bugs/5474.zig"); | ||
| 57 | _ = @import("behavior/bugs/5487.zig"); | ||
| 47 | _ = @import("behavior/bugs/6850.zig"); | 58 | _ = @import("behavior/bugs/6850.zig"); |
| 59 | _ = @import("behavior/bugs/7003.zig"); | ||
| 48 | _ = @import("behavior/bugs/7250.zig"); | 60 | _ = @import("behavior/bugs/7250.zig"); |
| 49 | _ = @import("behavior/bugs/11100.zig"); | 61 | _ = @import("behavior/bugs/11100.zig"); |
| 62 | _ = @import("behavior/bugs/10970.zig"); | ||
| 50 | _ = @import("behavior/call.zig"); | 63 | _ = @import("behavior/call.zig"); |
| 51 | _ = @import("behavior/cast.zig"); | 64 | _ = @import("behavior/cast.zig"); |
| 52 | _ = @import("behavior/comptime_memory.zig"); | 65 | _ = @import("behavior/comptime_memory.zig"); |
| 53 | _ = @import("behavior/defer.zig"); | 66 | _ = @import("behavior/defer.zig"); |
| 54 | _ = @import("behavior/enum.zig"); | 67 | _ = @import("behavior/enum.zig"); |
| 55 | _ = @import("behavior/error.zig"); | 68 | _ = @import("behavior/error.zig"); |
| 69 | _ = @import("behavior/field_parent_ptr.zig"); | ||
| 56 | _ = @import("behavior/floatop.zig"); | 70 | _ = @import("behavior/floatop.zig"); |
| 57 | _ = @import("behavior/fn.zig"); | ||
| 58 | _ = @import("behavior/fn_delegation.zig"); | 71 | _ = @import("behavior/fn_delegation.zig"); |
| 59 | _ = @import("behavior/fn_in_struct_in_comptime.zig"); | 72 | _ = @import("behavior/fn_in_struct_in_comptime.zig"); |
| 73 | _ = @import("behavior/fn.zig"); | ||
| 60 | _ = @import("behavior/for.zig"); | 74 | _ = @import("behavior/for.zig"); |
| 61 | _ = @import("behavior/generics.zig"); | 75 | _ = @import("behavior/generics.zig"); |
| 62 | _ = @import("behavior/hasdecl.zig"); | 76 | _ = @import("behavior/hasdecl.zig"); |
| ... | @@ -69,6 +83,7 @@ test { | ... | @@ -69,6 +83,7 @@ test { |
| 69 | _ = @import("behavior/ir_block_deps.zig"); | 83 | _ = @import("behavior/ir_block_deps.zig"); |
| 70 | _ = @import("behavior/math.zig"); | 84 | _ = @import("behavior/math.zig"); |
| 71 | _ = @import("behavior/member_func.zig"); | 85 | _ = @import("behavior/member_func.zig"); |
| 86 | _ = @import("behavior/merge_error_sets.zig"); | ||
| 72 | _ = @import("behavior/muladd.zig"); | 87 | _ = @import("behavior/muladd.zig"); |
| 73 | _ = @import("behavior/namespace_depends_on_compile_var.zig"); | 88 | _ = @import("behavior/namespace_depends_on_compile_var.zig"); |
| 74 | _ = @import("behavior/null.zig"); | 89 | _ = @import("behavior/null.zig"); |
| ... | @@ -79,10 +94,14 @@ test { | ... | @@ -79,10 +94,14 @@ test { |
| 79 | _ = @import("behavior/pub_enum.zig"); | 94 | _ = @import("behavior/pub_enum.zig"); |
| 80 | _ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig"); | 95 | _ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig"); |
| 81 | _ = @import("behavior/reflection.zig"); | 96 | _ = @import("behavior/reflection.zig"); |
| 82 | _ = @import("behavior/slice.zig"); | 97 | _ = @import("behavior/sizeof_and_typeof.zig"); |
| 83 | _ = @import("behavior/slice_sentinel_comptime.zig"); | 98 | _ = @import("behavior/slice_sentinel_comptime.zig"); |
| 99 | _ = @import("behavior/slice.zig"); | ||
| 84 | _ = @import("behavior/src.zig"); | 100 | _ = @import("behavior/src.zig"); |
| 101 | _ = @import("behavior/struct_contains_null_ptr_itself.zig"); | ||
| 85 | _ = @import("behavior/struct.zig"); | 102 | _ = @import("behavior/struct.zig"); |
| 103 | _ = @import("behavior/switch_prong_err_enum.zig"); | ||
| 104 | _ = @import("behavior/switch_prong_implicit_cast.zig"); | ||
| 86 | _ = @import("behavior/switch.zig"); | 105 | _ = @import("behavior/switch.zig"); |
| 87 | _ = @import("behavior/this.zig"); | 106 | _ = @import("behavior/this.zig"); |
| 88 | _ = @import("behavior/truncate.zig"); | 107 | _ = @import("behavior/truncate.zig"); |
| ... | @@ -113,22 +132,11 @@ test { | ... | @@ -113,22 +132,11 @@ test { |
| 113 | { | 132 | { |
| 114 | // Tests that pass for stage1, llvm backend, C backend | 133 | // Tests that pass for stage1, llvm backend, C backend |
| 115 | _ = @import("behavior/bugs/421.zig"); | 134 | _ = @import("behavior/bugs/421.zig"); |
| 116 | _ = @import("behavior/bugs/726.zig"); | ||
| 117 | _ = @import("behavior/bugs/828.zig"); | ||
| 118 | _ = @import("behavior/bugs/1421.zig"); | ||
| 119 | _ = @import("behavior/bugs/1607.zig"); | ||
| 120 | _ = @import("behavior/bugs/3384.zig"); | ||
| 121 | _ = @import("behavior/bugs/5398.zig"); | ||
| 122 | _ = @import("behavior/bugs/5413.zig"); | ||
| 123 | _ = @import("behavior/bugs/5474.zig"); | ||
| 124 | _ = @import("behavior/bugs/7003.zig"); | ||
| 125 | _ = @import("behavior/bugs/9584.zig"); | 135 | _ = @import("behavior/bugs/9584.zig"); |
| 126 | _ = @import("behavior/bugs/10970.zig"); | ||
| 127 | _ = @import("behavior/cast_int.zig"); | 136 | _ = @import("behavior/cast_int.zig"); |
| 128 | _ = @import("behavior/eval.zig"); | 137 | _ = @import("behavior/eval.zig"); |
| 129 | _ = @import("behavior/export_self_referential_type_info.zig"); | 138 | _ = @import("behavior/export_self_referential_type_info.zig"); |
| 130 | _ = @import("behavior/int128.zig"); | 139 | _ = @import("behavior/int128.zig"); |
| 131 | _ = @import("behavior/merge_error_sets.zig"); | ||
| 132 | _ = @import("behavior/translate_c_macros.zig"); | 140 | _ = @import("behavior/translate_c_macros.zig"); |
| 133 | 141 | ||
| 134 | if (builtin.zig_backend != .stage2_c) { | 142 | if (builtin.zig_backend != .stage2_c) { |
| ... | @@ -137,17 +145,9 @@ test { | ... | @@ -137,17 +145,9 @@ test { |
| 137 | _ = @import("behavior/maximum_minimum.zig"); | 145 | _ = @import("behavior/maximum_minimum.zig"); |
| 138 | _ = @import("behavior/popcount.zig"); | 146 | _ = @import("behavior/popcount.zig"); |
| 139 | _ = @import("behavior/saturating_arithmetic.zig"); | 147 | _ = @import("behavior/saturating_arithmetic.zig"); |
| 140 | _ = @import("behavior/sizeof_and_typeof.zig"); | ||
| 141 | _ = @import("behavior/widening.zig"); | 148 | _ = @import("behavior/widening.zig"); |
| 142 | _ = @import("behavior/bugs/1442.zig"); | ||
| 143 | _ = @import("behavior/bugs/2114.zig"); | 149 | _ = @import("behavior/bugs/2114.zig"); |
| 144 | _ = @import("behavior/bugs/3742.zig"); | ||
| 145 | _ = @import("behavior/bugs/5487.zig"); | ||
| 146 | _ = @import("behavior/struct_contains_null_ptr_itself.zig"); | ||
| 147 | _ = @import("behavior/switch_prong_err_enum.zig"); | ||
| 148 | _ = @import("behavior/switch_prong_implicit_cast.zig"); | ||
| 149 | _ = @import("behavior/union_with_members.zig"); | 150 | _ = @import("behavior/union_with_members.zig"); |
| 150 | _ = @import("behavior/field_parent_ptr.zig"); | ||
| 151 | 151 | ||
| 152 | if (builtin.zig_backend == .stage1) { | 152 | if (builtin.zig_backend == .stage1) { |
| 153 | // Tests that only pass for the stage1 backend. | 153 | // Tests that only pass for the stage1 backend. |
test/behavior/align.zig-3| ... | @@ -158,7 +158,6 @@ fn give() anyerror!u128 { | ... | @@ -158,7 +158,6 @@ fn give() anyerror!u128 { |
| 158 | 158 | ||
| 159 | test "page aligned array on stack" { | 159 | test "page aligned array on stack" { |
| 160 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 160 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 161 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 162 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 161 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 164 | 163 | ||
| ... | @@ -359,7 +358,6 @@ test "read 128-bit field from default aligned struct in global memory" { | ... | @@ -359,7 +358,6 @@ test "read 128-bit field from default aligned struct in global memory" { |
| 359 | test "struct field explicit alignment" { | 358 | test "struct field explicit alignment" { |
| 360 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 359 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 361 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 360 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 362 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 363 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 361 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 364 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 362 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 365 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 363 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| ... | @@ -411,7 +409,6 @@ test "align(N) on functions" { | ... | @@ -411,7 +409,6 @@ test "align(N) on functions" { |
| 411 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 409 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 412 | if (builtin.zig_backend == .stage1) return error.SkipZigTest; | 410 | if (builtin.zig_backend == .stage1) return error.SkipZigTest; |
| 413 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 411 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 414 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 415 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 412 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 416 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 413 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 417 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 414 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
test/behavior/bugs/10970.zig+4| ... | @@ -4,6 +4,10 @@ fn retOpt() ?u32 { | ... | @@ -4,6 +4,10 @@ fn retOpt() ?u32 { |
| 4 | return null; | 4 | return null; |
| 5 | } | 5 | } |
| 6 | test { | 6 | test { |
| 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 9 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 10 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 7 | var cond = true; | 11 | var cond = true; |
| 8 | const opt = while (cond) { | 12 | const opt = while (cond) { |
| 9 | if (retOpt()) |opt| { | 13 | if (retOpt()) |opt| { |
test/behavior/bugs/1421.zig+5| ... | @@ -1,5 +1,6 @@ | ... | @@ -1,5 +1,6 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const expect = std.testing.expect; | 2 | const expect = std.testing.expect; |
| 3 | const builtin = @import("builtin"); | ||
| 3 | 4 | ||
| 4 | const S = struct { | 5 | const S = struct { |
| 5 | fn method() std.builtin.Type { | 6 | fn method() std.builtin.Type { |
| ... | @@ -8,6 +9,10 @@ const S = struct { | ... | @@ -8,6 +9,10 @@ const S = struct { |
| 8 | }; | 9 | }; |
| 9 | 10 | ||
| 10 | test "functions with return type required to be comptime are generic" { | 11 | test "functions with return type required to be comptime are generic" { |
| 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 13 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 14 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 11 | const ti = S.method(); | 16 | const ti = S.method(); |
| 12 | try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct); | 17 | try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct); |
| 13 | } | 18 | } |
test/behavior/bugs/1442.zig+4| ... | @@ -7,6 +7,10 @@ const Union = union(enum) { | ... | @@ -7,6 +7,10 @@ const Union = union(enum) { |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | test "const error union field alignment" { | 9 | test "const error union field alignment" { |
| 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 12 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 13 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 10 | var union_or_err: anyerror!Union = Union{ .Color = 1234 }; | 14 | var union_or_err: anyerror!Union = Union{ .Color = 1234 }; |
| 11 | try std.testing.expect((union_or_err catch unreachable).Color == 1234); | 15 | try std.testing.expect((union_or_err catch unreachable).Color == 1234); |
| 12 | } | 16 | } |
test/behavior/bugs/1607.zig+5| ... | @@ -1,5 +1,6 @@ | ... | @@ -1,5 +1,6 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const testing = std.testing; | 2 | const testing = std.testing; |
| 3 | const builtin = @import("builtin"); | ||
| 3 | 4 | ||
| 4 | const a = [_]u8{ 1, 2, 3 }; | 5 | const a = [_]u8{ 1, 2, 3 }; |
| 5 | 6 | ||
| ... | @@ -10,6 +11,10 @@ fn checkAddress(s: []const u8) !void { | ... | @@ -10,6 +11,10 @@ fn checkAddress(s: []const u8) !void { |
| 10 | } | 11 | } |
| 11 | 12 | ||
| 12 | test "slices pointing at the same address as global array." { | 13 | test "slices pointing at the same address as global array." { |
| 14 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 16 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 17 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 13 | try checkAddress(&a); | 18 | try checkAddress(&a); |
| 14 | comptime try checkAddress(&a); | 19 | comptime try checkAddress(&a); |
| 15 | } | 20 | } |
test/behavior/bugs/3742.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | pub const GET = struct { | 4 | pub const GET = struct { |
| 4 | key: []const u8, | 5 | key: []const u8, |
| ... | @@ -34,5 +35,9 @@ pub const ArgSerializer = struct { | ... | @@ -34,5 +35,9 @@ pub const ArgSerializer = struct { |
| 34 | }; | 35 | }; |
| 35 | 36 | ||
| 36 | test "fixed" { | 37 | test "fixed" { |
| 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 39 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 40 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 41 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 37 | ArgSerializer.serializeCommand(GET.init("banana")); | 42 | ArgSerializer.serializeCommand(GET.init("banana")); |
| 38 | } | 43 | } |
test/behavior/bugs/5398.zig+5| ... | @@ -1,5 +1,6 @@ | ... | @@ -1,5 +1,6 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const testing = std.testing; | 2 | const testing = std.testing; |
| 3 | const builtin = @import("builtin"); | ||
| 3 | 4 | ||
| 4 | pub const Mesh = struct { | 5 | pub const Mesh = struct { |
| 5 | id: u32, | 6 | id: u32, |
| ... | @@ -18,6 +19,10 @@ pub const Renderable = struct { | ... | @@ -18,6 +19,10 @@ pub const Renderable = struct { |
| 18 | var renderable: Renderable = undefined; | 19 | var renderable: Renderable = undefined; |
| 19 | 20 | ||
| 20 | test "assignment of field with padding" { | 21 | test "assignment of field with padding" { |
| 22 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 23 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 24 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 25 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 21 | renderable = Renderable{ | 26 | renderable = Renderable{ |
| 22 | .mesh = Mesh{ .id = 0 }, | 27 | .mesh = Mesh{ .id = 0 }, |
| 23 | .material = Material{ | 28 | .material = Material{ |
test/behavior/bugs/5474.zig+8| ... | @@ -49,11 +49,19 @@ fn constant() !void { | ... | @@ -49,11 +49,19 @@ fn constant() !void { |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | test "pointer-to-array constness for zero-size elements, var" { | 51 | test "pointer-to-array constness for zero-size elements, var" { |
| 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 54 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 55 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 52 | try mutable(); | 56 | try mutable(); |
| 53 | comptime try mutable(); | 57 | comptime try mutable(); |
| 54 | } | 58 | } |
| 55 | 59 | ||
| 56 | test "pointer-to-array constness for zero-size elements, const" { | 60 | test "pointer-to-array constness for zero-size elements, const" { |
| 61 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 62 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 63 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 64 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 57 | try constant(); | 65 | try constant(); |
| 58 | comptime try constant(); | 66 | comptime try constant(); |
| 59 | } | 67 | } |
test/behavior/bugs/5487.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const io = @import("std").io; | 1 | const io = @import("std").io; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | pub fn write(_: void, bytes: []const u8) !usize { | 4 | pub fn write(_: void, bytes: []const u8) !usize { |
| 4 | _ = bytes; | 5 | _ = bytes; |
| ... | @@ -9,5 +10,9 @@ pub fn writer() io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_ty | ... | @@ -9,5 +10,9 @@ pub fn writer() io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_ty |
| 9 | } | 10 | } |
| 10 | 11 | ||
| 11 | test "crash" { | 12 | test "crash" { |
| 13 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 14 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 16 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 12 | _ = io.multiWriter(.{writer()}); | 17 | _ = io.multiWriter(.{writer()}); |
| 13 | } | 18 | } |
test/behavior/bugs/726.zig+11| ... | @@ -1,12 +1,23 @@ | ... | @@ -1,12 +1,23 @@ |
| 1 | const expect = @import("std").testing.expect; | 1 | const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | test "@ptrCast from const to nullable" { | 4 | test "@ptrCast from const to nullable" { |
| 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 6 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 9 | |||
| 4 | const c: u8 = 4; | 10 | const c: u8 = 4; |
| 5 | var x: ?*const u8 = @ptrCast(?*const u8, &c); | 11 | var x: ?*const u8 = @ptrCast(?*const u8, &c); |
| 6 | try expect(x.?.* == 4); | 12 | try expect(x.?.* == 4); |
| 7 | } | 13 | } |
| 8 | 14 | ||
| 9 | test "@ptrCast from var in empty struct to nullable" { | 15 | test "@ptrCast from var in empty struct to nullable" { |
| 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 18 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 19 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 20 | |||
| 10 | const container = struct { | 21 | const container = struct { |
| 11 | var c: u8 = 4; | 22 | var c: u8 = 4; |
| 12 | }; | 23 | }; |
test/behavior/bugs/828.zig+5| ... | @@ -1,3 +1,5 @@ | ... | @@ -1,3 +1,5 @@ |
| 1 | const builtin = @import("builtin"); | ||
| 2 | |||
| 1 | const CountBy = struct { | 3 | const CountBy = struct { |
| 2 | a: usize, | 4 | a: usize, |
| 3 | 5 | ||
| ... | @@ -28,6 +30,9 @@ fn constCount(comptime cb: *const CountBy, comptime unused: u32) void { | ... | @@ -28,6 +30,9 @@ fn constCount(comptime cb: *const CountBy, comptime unused: u32) void { |
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | test "comptime struct return should not return the same instance" { | 32 | test "comptime struct return should not return the same instance" { |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 34 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 35 | |||
| 31 | //the first parameter must be passed by reference to trigger the bug | 36 | //the first parameter must be passed by reference to trigger the bug |
| 32 | //a second parameter is required to trigger the bug | 37 | //a second parameter is required to trigger the bug |
| 33 | const ValA = constCount(&CountBy.One, 12); | 38 | const ValA = constCount(&CountBy.One, 12); |
test/behavior/enum.zig-1| ... | @@ -938,7 +938,6 @@ test "constant enum initialization with differing sizes" { | ... | @@ -938,7 +938,6 @@ test "constant enum initialization with differing sizes" { |
| 938 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 938 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 939 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 939 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 940 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 940 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 941 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 942 | 941 | ||
| 943 | try test3_1(test3_foo); | 942 | try test3_1(test3_foo); |
| 944 | try test3_2(test3_bar); | 943 | try test3_2(test3_bar); |
test/behavior/error.zig-3| ... | @@ -156,7 +156,6 @@ fn bar2() (error{}!void) {} | ... | @@ -156,7 +156,6 @@ fn bar2() (error{}!void) {} |
| 156 | 156 | ||
| 157 | test "error union type " { | 157 | test "error union type " { |
| 158 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 158 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 159 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 160 | 159 | ||
| 161 | try testErrorUnionType(); | 160 | try testErrorUnionType(); |
| 162 | comptime try testErrorUnionType(); | 161 | comptime try testErrorUnionType(); |
| ... | @@ -199,7 +198,6 @@ fn testErrorSetType() !void { | ... | @@ -199,7 +198,6 @@ fn testErrorSetType() !void { |
| 199 | test "explicit error set cast" { | 198 | test "explicit error set cast" { |
| 200 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 199 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 201 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 200 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 202 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 203 | 201 | ||
| 204 | try testExplicitErrorSetCast(Set1.A); | 202 | try testExplicitErrorSetCast(Set1.A); |
| 205 | comptime try testExplicitErrorSetCast(Set1.A); | 203 | comptime try testExplicitErrorSetCast(Set1.A); |
| ... | @@ -296,7 +294,6 @@ test "error: Infer error set from literals" { | ... | @@ -296,7 +294,6 @@ test "error: Infer error set from literals" { |
| 296 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 294 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 297 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 295 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 296 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 299 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 300 | 297 | ||
| 301 | _ = nullLiteral("n") catch |err| handleErrors(err); | 298 | _ = nullLiteral("n") catch |err| handleErrors(err); |
| 302 | _ = floatLiteral("n") catch |err| handleErrors(err); | 299 | _ = floatLiteral("n") catch |err| handleErrors(err); |
test/behavior/field_parent_ptr.zig+9| ... | @@ -1,11 +1,20 @@ | ... | @@ -1,11 +1,20 @@ |
| 1 | const expect = @import("std").testing.expect; | 1 | const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | test "@fieldParentPtr non-first field" { | 4 | test "@fieldParentPtr non-first field" { |
| 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 6 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 4 | try testParentFieldPtr(&foo.c); | 9 | try testParentFieldPtr(&foo.c); |
| 5 | comptime try testParentFieldPtr(&foo.c); | 10 | comptime try testParentFieldPtr(&foo.c); |
| 6 | } | 11 | } |
| 7 | 12 | ||
| 8 | test "@fieldParentPtr first field" { | 13 | test "@fieldParentPtr first field" { |
| 14 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 16 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 17 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 9 | try testParentFieldPtrFirst(&foo.a); | 18 | try testParentFieldPtrFirst(&foo.a); |
| 10 | comptime try testParentFieldPtrFirst(&foo.a); | 19 | comptime try testParentFieldPtrFirst(&foo.a); |
| 11 | } | 20 | } |
test/behavior/math.zig-1| ... | @@ -191,7 +191,6 @@ test "const number literal" { | ... | @@ -191,7 +191,6 @@ test "const number literal" { |
| 191 | const ten = 10; | 191 | const ten = 10; |
| 192 | 192 | ||
| 193 | test "float equality" { | 193 | test "float equality" { |
| 194 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 195 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 194 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 196 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 195 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 197 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 196 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
test/behavior/merge_error_sets.zig+5| ... | @@ -1,3 +1,4 @@ | ... | @@ -1,3 +1,4 @@ |
| 1 | const builtin = @import("builtin"); | ||
| 1 | const A = error{ | 2 | const A = error{ |
| 2 | FileNotFound, | 3 | FileNotFound, |
| 3 | NotDir, | 4 | NotDir, |
| ... | @@ -11,6 +12,10 @@ fn foo() C!void { | ... | @@ -11,6 +12,10 @@ fn foo() C!void { |
| 11 | } | 12 | } |
| 12 | 13 | ||
| 13 | test "merge error sets" { | 14 | test "merge error sets" { |
| 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 17 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 18 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 14 | if (foo()) { | 19 | if (foo()) { |
| 15 | @panic("unexpected"); | 20 | @panic("unexpected"); |
| 16 | } else |err| switch (err) { | 21 | } else |err| switch (err) { |
test/behavior/null.zig-1| ... | @@ -182,7 +182,6 @@ const here_is_a_null_literal = SillyStruct{ .context = null }; | ... | @@ -182,7 +182,6 @@ const here_is_a_null_literal = SillyStruct{ .context = null }; |
| 182 | 182 | ||
| 183 | test "unwrap optional which is field of global var" { | 183 | test "unwrap optional which is field of global var" { |
| 184 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 184 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 185 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 186 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 185 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 187 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 186 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 188 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 187 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
test/behavior/ptrcast.zig-1| ... | @@ -43,7 +43,6 @@ fn testReinterpretBytesAsExternStruct() !void { | ... | @@ -43,7 +43,6 @@ fn testReinterpretBytesAsExternStruct() !void { |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | test "reinterpret struct field at comptime" { | 45 | test "reinterpret struct field at comptime" { |
| 46 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 47 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 46 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 49 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 48 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
test/behavior/sizeof_and_typeof.zig+14| ... | @@ -18,6 +18,10 @@ test "@sizeOf on compile-time types" { | ... | @@ -18,6 +18,10 @@ test "@sizeOf on compile-time types" { |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | test "@TypeOf() with multiple arguments" { | 20 | test "@TypeOf() with multiple arguments" { |
| 21 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 22 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 23 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 24 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 21 | { | 25 | { |
| 22 | var var_1: u32 = undefined; | 26 | var var_1: u32 = undefined; |
| 23 | var var_2: u8 = undefined; | 27 | var var_2: u8 = undefined; |
| ... | @@ -74,6 +78,8 @@ const P = packed struct { | ... | @@ -74,6 +78,8 @@ const P = packed struct { |
| 74 | }; | 78 | }; |
| 75 | 79 | ||
| 76 | test "@offsetOf" { | 80 | test "@offsetOf" { |
| 81 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 77 | 83 | ||
| 78 | // Packed structs have fixed memory layout | 84 | // Packed structs have fixed memory layout |
| 79 | try expect(@offsetOf(P, "a") == 0); | 85 | try expect(@offsetOf(P, "a") == 0); |
| ... | @@ -180,6 +186,10 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" { | ... | @@ -180,6 +186,10 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" { |
| 180 | } | 186 | } |
| 181 | 187 | ||
| 182 | test "@TypeOf() has no runtime side effects" { | 188 | test "@TypeOf() has no runtime side effects" { |
| 189 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 190 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 191 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 192 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 183 | const S = struct { | 193 | const S = struct { |
| 184 | fn foo(comptime T: type, ptr: *T) T { | 194 | fn foo(comptime T: type, ptr: *T) T { |
| 185 | ptr.* += 1; | 195 | ptr.* += 1; |
| ... | @@ -193,6 +203,10 @@ test "@TypeOf() has no runtime side effects" { | ... | @@ -193,6 +203,10 @@ test "@TypeOf() has no runtime side effects" { |
| 193 | } | 203 | } |
| 194 | 204 | ||
| 195 | test "branching logic inside @TypeOf" { | 205 | test "branching logic inside @TypeOf" { |
| 206 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 207 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 208 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 209 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 196 | const S = struct { | 210 | const S = struct { |
| 197 | var data: i32 = 0; | 211 | var data: i32 = 0; |
| 198 | fn foo() anyerror!i32 { | 212 | fn foo() anyerror!i32 { |
test/behavior/struct_contains_null_ptr_itself.zig+5| ... | @@ -1,7 +1,12 @@ | ... | @@ -1,7 +1,12 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const expect = std.testing.expect; | 2 | const expect = std.testing.expect; |
| 3 | const builtin = @import("builtin"); | ||
| 3 | 4 | ||
| 4 | test "struct contains null pointer which contains original struct" { | 5 | test "struct contains null pointer which contains original struct" { |
| 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 9 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 5 | var x: ?*NodeLineComment = null; | 10 | var x: ?*NodeLineComment = null; |
| 6 | try expect(x == null); | 11 | try expect(x == null); |
| 7 | } | 12 | } |
test/behavior/switch_prong_err_enum.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const expect = @import("std").testing.expect; | 1 | const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | var read_count: u64 = 0; | 4 | var read_count: u64 = 0; |
| 4 | 5 | ||
| ... | @@ -20,6 +21,10 @@ fn doThing(form_id: u64) anyerror!FormValue { | ... | @@ -20,6 +21,10 @@ fn doThing(form_id: u64) anyerror!FormValue { |
| 20 | } | 21 | } |
| 21 | 22 | ||
| 22 | test "switch prong returns error enum" { | 23 | test "switch prong returns error enum" { |
| 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 25 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 26 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 27 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 23 | switch (doThing(17) catch unreachable) { | 28 | switch (doThing(17) catch unreachable) { |
| 24 | FormValue.Address => |payload| { | 29 | FormValue.Address => |payload| { |
| 25 | try expect(payload == 1); | 30 | try expect(payload == 1); |
test/behavior/switch_prong_implicit_cast.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const expect = @import("std").testing.expect; | 1 | const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | const FormValue = union(enum) { | 4 | const FormValue = union(enum) { |
| 4 | One: void, | 5 | One: void, |
| ... | @@ -14,6 +15,10 @@ fn foo(id: u64) !FormValue { | ... | @@ -14,6 +15,10 @@ fn foo(id: u64) !FormValue { |
| 14 | } | 15 | } |
| 15 | 16 | ||
| 16 | test "switch prong implicit cast" { | 17 | test "switch prong implicit cast" { |
| 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | ||
| 19 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | ||
| 20 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 21 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | ||
| 17 | const result = switch (foo(2) catch unreachable) { | 22 | const result = switch (foo(2) catch unreachable) { |
| 18 | FormValue.One => false, | 23 | FormValue.One => false, |
| 19 | FormValue.Two => |x| x, | 24 | FormValue.Two => |x| x, |
test/behavior/union.zig-1| ... | @@ -457,7 +457,6 @@ test "initialize global array of union" { | ... | @@ -457,7 +457,6 @@ test "initialize global array of union" { |
| 457 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 457 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 458 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 458 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 459 | 459 | ||
| 460 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 461 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 460 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 462 | 461 | ||
| 463 | glbl_array[1] = FooUnion{ .U1 = 2 }; | 462 | glbl_array[1] = FooUnion{ .U1 = 2 }; |
test/behavior/var_args.zig-3| ... | @@ -28,7 +28,6 @@ fn readFirstVarArg(args: anytype) void { | ... | @@ -28,7 +28,6 @@ fn readFirstVarArg(args: anytype) void { |
| 28 | 28 | ||
| 29 | test "send void arg to var args" { | 29 | test "send void arg to var args" { |
| 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 31 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 32 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 34 | 33 | ||
| ... | @@ -92,7 +91,6 @@ fn foo2(args: anytype) bool { | ... | @@ -92,7 +91,6 @@ fn foo2(args: anytype) bool { |
| 92 | 91 | ||
| 93 | test "array of var args functions" { | 92 | test "array of var args functions" { |
| 94 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 93 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 95 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 96 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 94 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 97 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 95 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 98 | 96 | ||
| ... | @@ -102,7 +100,6 @@ test "array of var args functions" { | ... | @@ -102,7 +100,6 @@ test "array of var args functions" { |
| 102 | 100 | ||
| 103 | test "pass zero length array to var args param" { | 101 | test "pass zero length array to var args param" { |
| 104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 102 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 105 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 106 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 103 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 107 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 104 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 108 | 105 |