mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
wasm: Enable passing behavior tests
This also adds some float-related instructions to MIR/Emit
This commit is contained in:
parent
3ea113e008
commit
90f08a69aa
@ -153,6 +153,34 @@ pub fn emitMir(emit: *Emit) InnerError!void {
|
|||||||
.i64_shl => try emit.emitTag(tag),
|
.i64_shl => try emit.emitTag(tag),
|
||||||
.i64_shr_s => try emit.emitTag(tag),
|
.i64_shr_s => try emit.emitTag(tag),
|
||||||
.i64_shr_u => try emit.emitTag(tag),
|
.i64_shr_u => try emit.emitTag(tag),
|
||||||
|
.f32_abs => try emit.emitTag(tag),
|
||||||
|
.f32_neg => try emit.emitTag(tag),
|
||||||
|
.f32_ceil => try emit.emitTag(tag),
|
||||||
|
.f32_floor => try emit.emitTag(tag),
|
||||||
|
.f32_trunc => try emit.emitTag(tag),
|
||||||
|
.f32_nearest => try emit.emitTag(tag),
|
||||||
|
.f32_sqrt => try emit.emitTag(tag),
|
||||||
|
.f32_add => try emit.emitTag(tag),
|
||||||
|
.f32_sub => try emit.emitTag(tag),
|
||||||
|
.f32_mul => try emit.emitTag(tag),
|
||||||
|
.f32_div => try emit.emitTag(tag),
|
||||||
|
.f32_min => try emit.emitTag(tag),
|
||||||
|
.f32_max => try emit.emitTag(tag),
|
||||||
|
.f32_copysign => try emit.emitTag(tag),
|
||||||
|
.f64_abs => try emit.emitTag(tag),
|
||||||
|
.f64_neg => try emit.emitTag(tag),
|
||||||
|
.f64_ceil => try emit.emitTag(tag),
|
||||||
|
.f64_floor => try emit.emitTag(tag),
|
||||||
|
.f64_trunc => try emit.emitTag(tag),
|
||||||
|
.f64_nearest => try emit.emitTag(tag),
|
||||||
|
.f64_sqrt => try emit.emitTag(tag),
|
||||||
|
.f64_add => try emit.emitTag(tag),
|
||||||
|
.f64_sub => try emit.emitTag(tag),
|
||||||
|
.f64_mul => try emit.emitTag(tag),
|
||||||
|
.f64_div => try emit.emitTag(tag),
|
||||||
|
.f64_min => try emit.emitTag(tag),
|
||||||
|
.f64_max => try emit.emitTag(tag),
|
||||||
|
.f64_copysign => try emit.emitTag(tag),
|
||||||
.i32_wrap_i64 => try emit.emitTag(tag),
|
.i32_wrap_i64 => try emit.emitTag(tag),
|
||||||
.i64_extend_i32_s => try emit.emitTag(tag),
|
.i64_extend_i32_s => try emit.emitTag(tag),
|
||||||
.i64_extend_i32_u => try emit.emitTag(tag),
|
.i64_extend_i32_u => try emit.emitTag(tag),
|
||||||
|
|||||||
@ -369,6 +369,62 @@ pub const Inst = struct {
|
|||||||
/// Uses `tag`
|
/// Uses `tag`
|
||||||
i64_shr_u = 0x88,
|
i64_shr_u = 0x88,
|
||||||
/// Uses `tag`
|
/// Uses `tag`
|
||||||
|
f32_abs = 0x8B,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_neg = 0x8C,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_ceil = 0x8D,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_floor = 0x8E,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_trunc = 0x8F,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_nearest = 0x90,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_sqrt = 0x91,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_add = 0x92,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_sub = 0x93,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_mul = 0x94,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_div = 0x95,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_min = 0x96,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_max = 0x97,
|
||||||
|
/// Uses `tag`
|
||||||
|
f32_copysign = 0x98,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_abs = 0x99,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_neg = 0x9A,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_ceil = 0x9B,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_floor = 0x9C,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_trunc = 0x9D,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_nearest = 0x9E,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_sqrt = 0x9F,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_add = 0xA0,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_sub = 0xA1,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_mul = 0xA2,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_div = 0xA3,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_min = 0xA4,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_max = 0xA5,
|
||||||
|
/// Uses `tag`
|
||||||
|
f64_copysign = 0xA6,
|
||||||
|
/// Uses `tag`
|
||||||
i32_wrap_i64 = 0xA7,
|
i32_wrap_i64 = 0xA7,
|
||||||
/// Uses `tag`
|
/// Uses `tag`
|
||||||
i32_trunc_f32_s = 0xA8,
|
i32_trunc_f32_s = 0xA8,
|
||||||
|
|||||||
@ -18,14 +18,19 @@ test {
|
|||||||
_ = @import("behavior/bugs/679.zig");
|
_ = @import("behavior/bugs/679.zig");
|
||||||
_ = @import("behavior/bugs/704.zig");
|
_ = @import("behavior/bugs/704.zig");
|
||||||
_ = @import("behavior/bugs/718.zig");
|
_ = @import("behavior/bugs/718.zig");
|
||||||
|
_ = @import("behavior/bugs/726.zig");
|
||||||
|
_ = @import("behavior/bugs/828.zig");
|
||||||
_ = @import("behavior/bugs/1025.zig");
|
_ = @import("behavior/bugs/1025.zig");
|
||||||
_ = @import("behavior/bugs/1076.zig");
|
_ = @import("behavior/bugs/1076.zig");
|
||||||
_ = @import("behavior/bugs/1111.zig");
|
_ = @import("behavior/bugs/1111.zig");
|
||||||
_ = @import("behavior/bugs/1277.zig");
|
_ = @import("behavior/bugs/1277.zig");
|
||||||
_ = @import("behavior/bugs/1310.zig");
|
_ = @import("behavior/bugs/1310.zig");
|
||||||
_ = @import("behavior/bugs/1381.zig");
|
_ = @import("behavior/bugs/1381.zig");
|
||||||
|
_ = @import("behavior/bugs/1421.zig");
|
||||||
|
_ = @import("behavior/bugs/1442.zig");
|
||||||
_ = @import("behavior/bugs/1486.zig");
|
_ = @import("behavior/bugs/1486.zig");
|
||||||
_ = @import("behavior/bugs/1500.zig");
|
_ = @import("behavior/bugs/1500.zig");
|
||||||
|
_ = @import("behavior/bugs/1607.zig");
|
||||||
_ = @import("behavior/bugs/1735.zig");
|
_ = @import("behavior/bugs/1735.zig");
|
||||||
_ = @import("behavior/bugs/1741.zig");
|
_ = @import("behavior/bugs/1741.zig");
|
||||||
_ = @import("behavior/bugs/1914.zig");
|
_ = @import("behavior/bugs/1914.zig");
|
||||||
@ -38,25 +43,34 @@ test {
|
|||||||
_ = @import("behavior/bugs/3046.zig");
|
_ = @import("behavior/bugs/3046.zig");
|
||||||
_ = @import("behavior/bugs/3112.zig");
|
_ = @import("behavior/bugs/3112.zig");
|
||||||
_ = @import("behavior/bugs/3367.zig");
|
_ = @import("behavior/bugs/3367.zig");
|
||||||
|
_ = @import("behavior/bugs/3384.zig");
|
||||||
_ = @import("behavior/bugs/3586.zig");
|
_ = @import("behavior/bugs/3586.zig");
|
||||||
|
_ = @import("behavior/bugs/3742.zig");
|
||||||
_ = @import("behavior/bugs/4328.zig");
|
_ = @import("behavior/bugs/4328.zig");
|
||||||
_ = @import("behavior/bugs/4560.zig");
|
_ = @import("behavior/bugs/4560.zig");
|
||||||
_ = @import("behavior/bugs/4769_a.zig");
|
_ = @import("behavior/bugs/4769_a.zig");
|
||||||
_ = @import("behavior/bugs/4769_b.zig");
|
_ = @import("behavior/bugs/4769_b.zig");
|
||||||
_ = @import("behavior/bugs/4954.zig");
|
_ = @import("behavior/bugs/4954.zig");
|
||||||
|
_ = @import("behavior/bugs/5398.zig");
|
||||||
|
_ = @import("behavior/bugs/5413.zig");
|
||||||
|
_ = @import("behavior/bugs/5474.zig");
|
||||||
|
_ = @import("behavior/bugs/5487.zig");
|
||||||
_ = @import("behavior/bugs/6850.zig");
|
_ = @import("behavior/bugs/6850.zig");
|
||||||
|
_ = @import("behavior/bugs/7003.zig");
|
||||||
_ = @import("behavior/bugs/7250.zig");
|
_ = @import("behavior/bugs/7250.zig");
|
||||||
_ = @import("behavior/bugs/11100.zig");
|
_ = @import("behavior/bugs/11100.zig");
|
||||||
|
_ = @import("behavior/bugs/10970.zig");
|
||||||
_ = @import("behavior/call.zig");
|
_ = @import("behavior/call.zig");
|
||||||
_ = @import("behavior/cast.zig");
|
_ = @import("behavior/cast.zig");
|
||||||
_ = @import("behavior/comptime_memory.zig");
|
_ = @import("behavior/comptime_memory.zig");
|
||||||
_ = @import("behavior/defer.zig");
|
_ = @import("behavior/defer.zig");
|
||||||
_ = @import("behavior/enum.zig");
|
_ = @import("behavior/enum.zig");
|
||||||
_ = @import("behavior/error.zig");
|
_ = @import("behavior/error.zig");
|
||||||
|
_ = @import("behavior/field_parent_ptr.zig");
|
||||||
_ = @import("behavior/floatop.zig");
|
_ = @import("behavior/floatop.zig");
|
||||||
_ = @import("behavior/fn.zig");
|
|
||||||
_ = @import("behavior/fn_delegation.zig");
|
_ = @import("behavior/fn_delegation.zig");
|
||||||
_ = @import("behavior/fn_in_struct_in_comptime.zig");
|
_ = @import("behavior/fn_in_struct_in_comptime.zig");
|
||||||
|
_ = @import("behavior/fn.zig");
|
||||||
_ = @import("behavior/for.zig");
|
_ = @import("behavior/for.zig");
|
||||||
_ = @import("behavior/generics.zig");
|
_ = @import("behavior/generics.zig");
|
||||||
_ = @import("behavior/hasdecl.zig");
|
_ = @import("behavior/hasdecl.zig");
|
||||||
@ -69,6 +83,7 @@ test {
|
|||||||
_ = @import("behavior/ir_block_deps.zig");
|
_ = @import("behavior/ir_block_deps.zig");
|
||||||
_ = @import("behavior/math.zig");
|
_ = @import("behavior/math.zig");
|
||||||
_ = @import("behavior/member_func.zig");
|
_ = @import("behavior/member_func.zig");
|
||||||
|
_ = @import("behavior/merge_error_sets.zig");
|
||||||
_ = @import("behavior/muladd.zig");
|
_ = @import("behavior/muladd.zig");
|
||||||
_ = @import("behavior/namespace_depends_on_compile_var.zig");
|
_ = @import("behavior/namespace_depends_on_compile_var.zig");
|
||||||
_ = @import("behavior/null.zig");
|
_ = @import("behavior/null.zig");
|
||||||
@ -79,10 +94,14 @@ test {
|
|||||||
_ = @import("behavior/pub_enum.zig");
|
_ = @import("behavior/pub_enum.zig");
|
||||||
_ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig");
|
_ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig");
|
||||||
_ = @import("behavior/reflection.zig");
|
_ = @import("behavior/reflection.zig");
|
||||||
_ = @import("behavior/slice.zig");
|
_ = @import("behavior/sizeof_and_typeof.zig");
|
||||||
_ = @import("behavior/slice_sentinel_comptime.zig");
|
_ = @import("behavior/slice_sentinel_comptime.zig");
|
||||||
|
_ = @import("behavior/slice.zig");
|
||||||
_ = @import("behavior/src.zig");
|
_ = @import("behavior/src.zig");
|
||||||
|
_ = @import("behavior/struct_contains_null_ptr_itself.zig");
|
||||||
_ = @import("behavior/struct.zig");
|
_ = @import("behavior/struct.zig");
|
||||||
|
_ = @import("behavior/switch_prong_err_enum.zig");
|
||||||
|
_ = @import("behavior/switch_prong_implicit_cast.zig");
|
||||||
_ = @import("behavior/switch.zig");
|
_ = @import("behavior/switch.zig");
|
||||||
_ = @import("behavior/this.zig");
|
_ = @import("behavior/this.zig");
|
||||||
_ = @import("behavior/truncate.zig");
|
_ = @import("behavior/truncate.zig");
|
||||||
@ -113,22 +132,11 @@ test {
|
|||||||
{
|
{
|
||||||
// Tests that pass for stage1, llvm backend, C backend
|
// Tests that pass for stage1, llvm backend, C backend
|
||||||
_ = @import("behavior/bugs/421.zig");
|
_ = @import("behavior/bugs/421.zig");
|
||||||
_ = @import("behavior/bugs/726.zig");
|
|
||||||
_ = @import("behavior/bugs/828.zig");
|
|
||||||
_ = @import("behavior/bugs/1421.zig");
|
|
||||||
_ = @import("behavior/bugs/1607.zig");
|
|
||||||
_ = @import("behavior/bugs/3384.zig");
|
|
||||||
_ = @import("behavior/bugs/5398.zig");
|
|
||||||
_ = @import("behavior/bugs/5413.zig");
|
|
||||||
_ = @import("behavior/bugs/5474.zig");
|
|
||||||
_ = @import("behavior/bugs/7003.zig");
|
|
||||||
_ = @import("behavior/bugs/9584.zig");
|
_ = @import("behavior/bugs/9584.zig");
|
||||||
_ = @import("behavior/bugs/10970.zig");
|
|
||||||
_ = @import("behavior/cast_int.zig");
|
_ = @import("behavior/cast_int.zig");
|
||||||
_ = @import("behavior/eval.zig");
|
_ = @import("behavior/eval.zig");
|
||||||
_ = @import("behavior/export_self_referential_type_info.zig");
|
_ = @import("behavior/export_self_referential_type_info.zig");
|
||||||
_ = @import("behavior/int128.zig");
|
_ = @import("behavior/int128.zig");
|
||||||
_ = @import("behavior/merge_error_sets.zig");
|
|
||||||
_ = @import("behavior/translate_c_macros.zig");
|
_ = @import("behavior/translate_c_macros.zig");
|
||||||
|
|
||||||
if (builtin.zig_backend != .stage2_c) {
|
if (builtin.zig_backend != .stage2_c) {
|
||||||
@ -137,17 +145,9 @@ test {
|
|||||||
_ = @import("behavior/maximum_minimum.zig");
|
_ = @import("behavior/maximum_minimum.zig");
|
||||||
_ = @import("behavior/popcount.zig");
|
_ = @import("behavior/popcount.zig");
|
||||||
_ = @import("behavior/saturating_arithmetic.zig");
|
_ = @import("behavior/saturating_arithmetic.zig");
|
||||||
_ = @import("behavior/sizeof_and_typeof.zig");
|
|
||||||
_ = @import("behavior/widening.zig");
|
_ = @import("behavior/widening.zig");
|
||||||
_ = @import("behavior/bugs/1442.zig");
|
|
||||||
_ = @import("behavior/bugs/2114.zig");
|
_ = @import("behavior/bugs/2114.zig");
|
||||||
_ = @import("behavior/bugs/3742.zig");
|
|
||||||
_ = @import("behavior/bugs/5487.zig");
|
|
||||||
_ = @import("behavior/struct_contains_null_ptr_itself.zig");
|
|
||||||
_ = @import("behavior/switch_prong_err_enum.zig");
|
|
||||||
_ = @import("behavior/switch_prong_implicit_cast.zig");
|
|
||||||
_ = @import("behavior/union_with_members.zig");
|
_ = @import("behavior/union_with_members.zig");
|
||||||
_ = @import("behavior/field_parent_ptr.zig");
|
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage1) {
|
if (builtin.zig_backend == .stage1) {
|
||||||
// Tests that only pass for the stage1 backend.
|
// Tests that only pass for the stage1 backend.
|
||||||
|
|||||||
@ -158,7 +158,6 @@ fn give() anyerror!u128 {
|
|||||||
|
|
||||||
test "page aligned array on stack" {
|
test "page aligned array on stack" {
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
|
||||||
@ -359,7 +358,6 @@ test "read 128-bit field from default aligned struct in global memory" {
|
|||||||
test "struct field explicit alignment" {
|
test "struct field explicit alignment" {
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
@ -411,7 +409,6 @@ test "align(N) on functions" {
|
|||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
|||||||
@ -4,6 +4,10 @@ fn retOpt() ?u32 {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
test {
|
test {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
var cond = true;
|
var cond = true;
|
||||||
const opt = while (cond) {
|
const opt = while (cond) {
|
||||||
if (retOpt()) |opt| {
|
if (retOpt()) |opt| {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const expect = std.testing.expect;
|
const expect = std.testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
const S = struct {
|
const S = struct {
|
||||||
fn method() std.builtin.Type {
|
fn method() std.builtin.Type {
|
||||||
@ -8,6 +9,10 @@ const S = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test "functions with return type required to be comptime are generic" {
|
test "functions with return type required to be comptime are generic" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
const ti = S.method();
|
const ti = S.method();
|
||||||
try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct);
|
try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,10 @@ const Union = union(enum) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test "const error union field alignment" {
|
test "const error union field alignment" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
var union_or_err: anyerror!Union = Union{ .Color = 1234 };
|
var union_or_err: anyerror!Union = Union{ .Color = 1234 };
|
||||||
try std.testing.expect((union_or_err catch unreachable).Color == 1234);
|
try std.testing.expect((union_or_err catch unreachable).Color == 1234);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
const a = [_]u8{ 1, 2, 3 };
|
const a = [_]u8{ 1, 2, 3 };
|
||||||
|
|
||||||
@ -10,6 +11,10 @@ fn checkAddress(s: []const u8) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "slices pointing at the same address as global array." {
|
test "slices pointing at the same address as global array." {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
try checkAddress(&a);
|
try checkAddress(&a);
|
||||||
comptime try checkAddress(&a);
|
comptime try checkAddress(&a);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
pub const GET = struct {
|
pub const GET = struct {
|
||||||
key: []const u8,
|
key: []const u8,
|
||||||
@ -34,5 +35,9 @@ pub const ArgSerializer = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test "fixed" {
|
test "fixed" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
ArgSerializer.serializeCommand(GET.init("banana"));
|
ArgSerializer.serializeCommand(GET.init("banana"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
pub const Mesh = struct {
|
pub const Mesh = struct {
|
||||||
id: u32,
|
id: u32,
|
||||||
@ -18,6 +19,10 @@ pub const Renderable = struct {
|
|||||||
var renderable: Renderable = undefined;
|
var renderable: Renderable = undefined;
|
||||||
|
|
||||||
test "assignment of field with padding" {
|
test "assignment of field with padding" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
renderable = Renderable{
|
renderable = Renderable{
|
||||||
.mesh = Mesh{ .id = 0 },
|
.mesh = Mesh{ .id = 0 },
|
||||||
.material = Material{
|
.material = Material{
|
||||||
|
|||||||
@ -49,11 +49,19 @@ fn constant() !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "pointer-to-array constness for zero-size elements, var" {
|
test "pointer-to-array constness for zero-size elements, var" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
try mutable();
|
try mutable();
|
||||||
comptime try mutable();
|
comptime try mutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
test "pointer-to-array constness for zero-size elements, const" {
|
test "pointer-to-array constness for zero-size elements, const" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
try constant();
|
try constant();
|
||||||
comptime try constant();
|
comptime try constant();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const io = @import("std").io;
|
const io = @import("std").io;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
pub fn write(_: void, bytes: []const u8) !usize {
|
pub fn write(_: void, bytes: []const u8) !usize {
|
||||||
_ = bytes;
|
_ = bytes;
|
||||||
@ -9,5 +10,9 @@ pub fn writer() io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_ty
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "crash" {
|
test "crash" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
_ = io.multiWriter(.{writer()});
|
_ = io.multiWriter(.{writer()});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,23 @@
|
|||||||
const expect = @import("std").testing.expect;
|
const expect = @import("std").testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
test "@ptrCast from const to nullable" {
|
test "@ptrCast from const to nullable" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
|
|
||||||
const c: u8 = 4;
|
const c: u8 = 4;
|
||||||
var x: ?*const u8 = @ptrCast(?*const u8, &c);
|
var x: ?*const u8 = @ptrCast(?*const u8, &c);
|
||||||
try expect(x.?.* == 4);
|
try expect(x.?.* == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "@ptrCast from var in empty struct to nullable" {
|
test "@ptrCast from var in empty struct to nullable" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
|
|
||||||
const container = struct {
|
const container = struct {
|
||||||
var c: u8 = 4;
|
var c: u8 = 4;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
const CountBy = struct {
|
const CountBy = struct {
|
||||||
a: usize,
|
a: usize,
|
||||||
|
|
||||||
@ -28,6 +30,9 @@ fn constCount(comptime cb: *const CountBy, comptime unused: u32) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "comptime struct return should not return the same instance" {
|
test "comptime struct return should not return the same instance" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
|
||||||
//the first parameter must be passed by reference to trigger the bug
|
//the first parameter must be passed by reference to trigger the bug
|
||||||
//a second parameter is required to trigger the bug
|
//a second parameter is required to trigger the bug
|
||||||
const ValA = constCount(&CountBy.One, 12);
|
const ValA = constCount(&CountBy.One, 12);
|
||||||
|
|||||||
@ -938,7 +938,6 @@ test "constant enum initialization with differing sizes" {
|
|||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
|
|
||||||
try test3_1(test3_foo);
|
try test3_1(test3_foo);
|
||||||
try test3_2(test3_bar);
|
try test3_2(test3_bar);
|
||||||
|
|||||||
@ -156,7 +156,6 @@ fn bar2() (error{}!void) {}
|
|||||||
|
|
||||||
test "error union type " {
|
test "error union type " {
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
|
|
||||||
try testErrorUnionType();
|
try testErrorUnionType();
|
||||||
comptime try testErrorUnionType();
|
comptime try testErrorUnionType();
|
||||||
@ -199,7 +198,6 @@ fn testErrorSetType() !void {
|
|||||||
test "explicit error set cast" {
|
test "explicit error set cast" {
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
|
|
||||||
try testExplicitErrorSetCast(Set1.A);
|
try testExplicitErrorSetCast(Set1.A);
|
||||||
comptime try testExplicitErrorSetCast(Set1.A);
|
comptime try testExplicitErrorSetCast(Set1.A);
|
||||||
@ -296,7 +294,6 @@ test "error: Infer error set from literals" {
|
|||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
|
|
||||||
_ = nullLiteral("n") catch |err| handleErrors(err);
|
_ = nullLiteral("n") catch |err| handleErrors(err);
|
||||||
_ = floatLiteral("n") catch |err| handleErrors(err);
|
_ = floatLiteral("n") catch |err| handleErrors(err);
|
||||||
|
|||||||
@ -1,11 +1,20 @@
|
|||||||
const expect = @import("std").testing.expect;
|
const expect = @import("std").testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
test "@fieldParentPtr non-first field" {
|
test "@fieldParentPtr non-first field" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
try testParentFieldPtr(&foo.c);
|
try testParentFieldPtr(&foo.c);
|
||||||
comptime try testParentFieldPtr(&foo.c);
|
comptime try testParentFieldPtr(&foo.c);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "@fieldParentPtr first field" {
|
test "@fieldParentPtr first field" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
try testParentFieldPtrFirst(&foo.a);
|
try testParentFieldPtrFirst(&foo.a);
|
||||||
comptime try testParentFieldPtrFirst(&foo.a);
|
comptime try testParentFieldPtrFirst(&foo.a);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,7 +191,6 @@ test "const number literal" {
|
|||||||
const ten = 10;
|
const ten = 10;
|
||||||
|
|
||||||
test "float equality" {
|
test "float equality" {
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
const builtin = @import("builtin");
|
||||||
const A = error{
|
const A = error{
|
||||||
FileNotFound,
|
FileNotFound,
|
||||||
NotDir,
|
NotDir,
|
||||||
@ -11,6 +12,10 @@ fn foo() C!void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "merge error sets" {
|
test "merge error sets" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
if (foo()) {
|
if (foo()) {
|
||||||
@panic("unexpected");
|
@panic("unexpected");
|
||||||
} else |err| switch (err) {
|
} else |err| switch (err) {
|
||||||
|
|||||||
@ -182,7 +182,6 @@ const here_is_a_null_literal = SillyStruct{ .context = null };
|
|||||||
|
|
||||||
test "unwrap optional which is field of global var" {
|
test "unwrap optional which is field of global var" {
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
|||||||
@ -43,7 +43,6 @@ fn testReinterpretBytesAsExternStruct() !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "reinterpret struct field at comptime" {
|
test "reinterpret struct field at comptime" {
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||||
|
|||||||
@ -18,6 +18,10 @@ test "@sizeOf on compile-time types" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "@TypeOf() with multiple arguments" {
|
test "@TypeOf() with multiple arguments" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
{
|
{
|
||||||
var var_1: u32 = undefined;
|
var var_1: u32 = undefined;
|
||||||
var var_2: u8 = undefined;
|
var var_2: u8 = undefined;
|
||||||
@ -74,6 +78,8 @@ const P = packed struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test "@offsetOf" {
|
test "@offsetOf" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
|
||||||
// Packed structs have fixed memory layout
|
// Packed structs have fixed memory layout
|
||||||
try expect(@offsetOf(P, "a") == 0);
|
try expect(@offsetOf(P, "a") == 0);
|
||||||
@ -180,6 +186,10 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "@TypeOf() has no runtime side effects" {
|
test "@TypeOf() has no runtime side effects" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
const S = struct {
|
const S = struct {
|
||||||
fn foo(comptime T: type, ptr: *T) T {
|
fn foo(comptime T: type, ptr: *T) T {
|
||||||
ptr.* += 1;
|
ptr.* += 1;
|
||||||
@ -193,6 +203,10 @@ test "@TypeOf() has no runtime side effects" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "branching logic inside @TypeOf" {
|
test "branching logic inside @TypeOf" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
const S = struct {
|
const S = struct {
|
||||||
var data: i32 = 0;
|
var data: i32 = 0;
|
||||||
fn foo() anyerror!i32 {
|
fn foo() anyerror!i32 {
|
||||||
|
|||||||
@ -1,7 +1,12 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const expect = std.testing.expect;
|
const expect = std.testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
test "struct contains null pointer which contains original struct" {
|
test "struct contains null pointer which contains original struct" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
var x: ?*NodeLineComment = null;
|
var x: ?*NodeLineComment = null;
|
||||||
try expect(x == null);
|
try expect(x == null);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const expect = @import("std").testing.expect;
|
const expect = @import("std").testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
var read_count: u64 = 0;
|
var read_count: u64 = 0;
|
||||||
|
|
||||||
@ -20,6 +21,10 @@ fn doThing(form_id: u64) anyerror!FormValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "switch prong returns error enum" {
|
test "switch prong returns error enum" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
switch (doThing(17) catch unreachable) {
|
switch (doThing(17) catch unreachable) {
|
||||||
FormValue.Address => |payload| {
|
FormValue.Address => |payload| {
|
||||||
try expect(payload == 1);
|
try expect(payload == 1);
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const expect = @import("std").testing.expect;
|
const expect = @import("std").testing.expect;
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
const FormValue = union(enum) {
|
const FormValue = union(enum) {
|
||||||
One: void,
|
One: void,
|
||||||
@ -14,6 +15,10 @@ fn foo(id: u64) !FormValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "switch prong implicit cast" {
|
test "switch prong implicit cast" {
|
||||||
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
const result = switch (foo(2) catch unreachable) {
|
const result = switch (foo(2) catch unreachable) {
|
||||||
FormValue.One => false,
|
FormValue.One => false,
|
||||||
FormValue.Two => |x| x,
|
FormValue.Two => |x| x,
|
||||||
|
|||||||
@ -457,7 +457,6 @@ test "initialize global array of union" {
|
|||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||||
|
|
||||||
glbl_array[1] = FooUnion{ .U1 = 2 };
|
glbl_array[1] = FooUnion{ .U1 = 2 };
|
||||||
|
|||||||
@ -28,7 +28,6 @@ fn readFirstVarArg(args: anytype) void {
|
|||||||
|
|
||||||
test "send void arg to var args" {
|
test "send void arg to var args" {
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
|
|
||||||
@ -92,7 +91,6 @@ fn foo2(args: anytype) bool {
|
|||||||
|
|
||||||
test "array of var args functions" {
|
test "array of var args functions" {
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
|
|
||||||
@ -102,7 +100,6 @@ test "array of var args functions" {
|
|||||||
|
|
||||||
test "pass zero length array to var args param" {
|
test "pass zero length array to var args param" {
|
||||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
||||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user