zig/test/behavior/bugs/12801-2.zig
Cody Tapscott 83e2d3fb37 stage1: Skip new tests that never passed in stage1
This gets the behavior tests passing for stage1 again.
2022-10-13 12:53:20 -07:00

26 lines
765 B
Zig

const std = @import("std");
const builtin = @import("builtin");
const Auto = struct {
auto: [max_len]u8 = undefined,
offset: u64 = 0,
comptime capacity: *const fn () u64 = capacity,
const max_len: u64 = 32;
fn capacity() u64 {
return max_len;
}
};
test {
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
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_x86_64) return error.SkipZigTest; // TODO
const a: Auto = .{ .offset = 16, .capacity = Auto.capacity };
try std.testing.expect(a.capacity() == 32);
try std.testing.expect((a.capacity)() == 32);
}