authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-07 03:06:10-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-12-07 03:06:10-05:00
log53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c
tree741ec2205c1c47afbd262044f804b14a7a037fbe
parent8ccb9a6ad327a4d7fbc321b33d4aa66a27a1f5ee
parent50eb7983cde6e07d2613a6f3ab164ca055d9306f
signature Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #13799 from ziglang/close-stage1-issues

close stage1 issues

154 files changed, 537 insertions(+), 1235 deletions(-)

lib/std/atomic/Atomic.zig+2-2
......@@ -214,8 +214,8 @@ pub fn Atomic(comptime T: type) type {
214214 inline fn bitRmw(self: *Self, comptime op: BitRmwOp, bit: Bit, comptime ordering: Ordering) u1 {
215215 // x86 supports dedicated bitwise instructions
216216 if (comptime builtin.target.cpu.arch.isX86() and @sizeOf(T) >= 2 and @sizeOf(T) <= 8) {
217 // TODO: stage2 currently doesn't like the inline asm this function emits.
218 if (builtin.zig_backend == .stage1) {
217 // TODO: this causes std lib test failures when enabled
218 if (false) {
219219 return x86BitRmw(self, op, bit, ordering);
220220 }
221221 }
lib/std/base64.zig+1-1
......@@ -9,7 +9,7 @@ pub const Error = error{
99 NoSpaceLeft,
1010};
1111
12const decoderWithIgnoreProto = std.meta.FnPtr(fn (ignore: []const u8) Base64DecoderWithIgnore);
12const decoderWithIgnoreProto = *const fn (ignore: []const u8) Base64DecoderWithIgnore;
1313
1414/// Base64 codecs
1515pub const Codecs = struct {
lib/std/build.zig+2-3
......@@ -3293,8 +3293,7 @@ pub const LibExeObjStep = struct {
32933293 while (try it.next()) |entry| {
32943294 // The compiler can put these files into the same directory, but we don't
32953295 // want to copy them over.
3296 if (mem.eql(u8, entry.name, "stage1.id") or
3297 mem.eql(u8, entry.name, "llvm-ar.id") or
3296 if (mem.eql(u8, entry.name, "llvm-ar.id") or
32983297 mem.eql(u8, entry.name, "libs.txt") or
32993298 mem.eql(u8, entry.name, "builtin.zig") or
33003299 mem.eql(u8, entry.name, "zld.id") or
......@@ -3607,7 +3606,7 @@ pub const Step = struct {
36073606 loop_flag: bool,
36083607 done_flag: bool,
36093608
3610 const MakeFn = std.meta.FnPtr(fn (self: *Step) anyerror!void);
3609 const MakeFn = *const fn (self: *Step) anyerror!void;
36113610
36123611 pub const Id = enum {
36133612 top_level,
lib/std/build/WriteFileStep.zig+3-3
......@@ -62,9 +62,9 @@ fn make(step: *Step) !void {
6262 // If, for example, a hard-coded path was used as the location to put WriteFileStep
6363 // files, then two WriteFileSteps executing in parallel might clobber each other.
6464
65 // TODO port the cache system from stage1 to zig std lib. Until then we use blake2b
66 // directly and construct the path, and no "cache hit" detection happens; the files
67 // are always written.
65 // TODO port the cache system from the compiler to zig std lib. Until then
66 // we use blake2b directly and construct the path, and no "cache hit"
67 // detection happens; the files are always written.
6868 var hash = std.crypto.hash.blake2.Blake2b384.init(.{});
6969
7070 // Random bytes to make WriteFileStep unique. Refresh this with
lib/std/builtin.zig+6-5
......@@ -698,8 +698,9 @@ pub const CompilerBackend = enum(u64) {
698698 /// in which case this value is appropriate. Be cool and make sure your
699699 /// code supports `other` Zig compilers!
700700 other = 0,
701 /// The original Zig compiler created in 2015 by Andrew Kelley.
702 /// Implemented in C++. Uses LLVM.
701 /// The original Zig compiler created in 2015 by Andrew Kelley. Implemented
702 /// in C++. Used LLVM. Deleted from the ZSF ziglang/zig codebase on
703 /// December 6th, 2022.
703704 stage1 = 1,
704705 /// The reference implementation self-hosted compiler of Zig, using the
705706 /// LLVM backend.
......@@ -738,7 +739,7 @@ pub const CompilerBackend = enum(u64) {
738739/// therefore must be kept in sync with the compiler implementation.
739740pub const TestFn = struct {
740741 name: []const u8,
741 func: std.meta.FnPtr(fn () anyerror!void),
742 func: *const fn () anyerror!void,
742743 async_frame_size: ?usize,
743744};
744745
......@@ -760,8 +761,8 @@ else
760761pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr: ?usize) noreturn {
761762 @setCold(true);
762763
763 // Until self-hosted catches up with stage1 language features, we have a simpler
764 // default panic function:
764 // For backends that cannot handle the language features depended on by the
765 // default panic handler, we have a simpler panic handler:
765766 if (builtin.zig_backend == .stage2_c or
766767 builtin.zig_backend == .stage2_wasm or
767768 builtin.zig_backend == .stage2_arm or
lib/std/c.zig+13-8
......@@ -241,8 +241,12 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int;
241241pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int;
242242pub extern "c" fn futimens(fd: c.fd_t, times: *const [2]c.timespec) c_int;
243243
244const PThreadStartFn = std.meta.FnPtr(fn (?*anyopaque) callconv(.C) ?*anyopaque);
245pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const c.pthread_attr_t, start_routine: PThreadStartFn, noalias arg: ?*anyopaque) c.E;
244pub extern "c" fn pthread_create(
245 noalias newthread: *pthread_t,
246 noalias attr: ?*const c.pthread_attr_t,
247 start_routine: *const fn (?*anyopaque) callconv(.C) ?*anyopaque,
248 noalias arg: ?*anyopaque,
249) c.E;
246250pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E;
247251pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) c.E;
248252pub extern "c" fn pthread_attr_setstacksize(attr: *c.pthread_attr_t, stacksize: usize) c.E;
......@@ -251,14 +255,15 @@ pub extern "c" fn pthread_attr_destroy(attr: *c.pthread_attr_t) c.E;
251255pub extern "c" fn pthread_self() pthread_t;
252256pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) c.E;
253257pub extern "c" fn pthread_detach(thread: pthread_t) c.E;
254const PThreadForkFn = std.meta.FnPtr(fn () callconv(.C) void);
255258pub extern "c" fn pthread_atfork(
256 prepare: ?PThreadForkFn,
257 parent: ?PThreadForkFn,
258 child: ?PThreadForkFn,
259 prepare: ?*const fn () callconv(.C) void,
260 parent: ?*const fn () callconv(.C) void,
261 child: ?*const fn () callconv(.C) void,
259262) c_int;
260const PThreadKeyCreateFn = std.meta.FnPtr(fn (value: *anyopaque) callconv(.C) void);
261pub extern "c" fn pthread_key_create(key: *c.pthread_key_t, destructor: ?PThreadKeyCreateFn) c.E;
263pub extern "c" fn pthread_key_create(
264 key: *c.pthread_key_t,
265 destructor: ?*const fn (value: *anyopaque) callconv(.C) void,
266) c.E;
262267pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E;
263268pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*anyopaque;
264269pub extern "c" fn pthread_setspecific(key: c.pthread_key_t, value: ?*anyopaque) c_int;
lib/std/c/darwin.zig+2-2
......@@ -918,8 +918,8 @@ pub const siginfo_t = extern struct {
918918
919919/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
920920pub const Sigaction = extern struct {
921 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
922 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
921 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
922 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
923923
924924 handler: extern union {
925925 handler: ?handler_fn,
lib/std/c/dragonfly.zig+3-3
......@@ -13,7 +13,7 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
1313pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
1414pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;
1515
16pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
16pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
1717pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1818
1919pub extern "c" fn lwp_gettid() c_int;
......@@ -681,8 +681,8 @@ pub const empty_sigset = sigset_t{ .__bits = [_]c_uint{0} ** _SIG_WORDS };
681681pub const sig_atomic_t = c_int;
682682
683683pub const Sigaction = extern struct {
684 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
685 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
684 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
685 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
686686
687687 /// signal handler
688688 handler: extern union {
lib/std/c/freebsd.zig+3-3
......@@ -37,7 +37,7 @@ pub extern "c" fn sendfile(
3737 flags: u32,
3838) c_int;
3939
40pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
40pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
4141pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
4242
4343pub const pthread_mutex_t = extern struct {
......@@ -1197,8 +1197,8 @@ const NSIG = 32;
11971197
11981198/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
11991199pub const Sigaction = extern struct {
1200 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
1201 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
1200 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
1201 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
12021202
12031203 /// signal handler
12041204 handler: extern union {
lib/std/c/haiku.zig+1-1
......@@ -742,7 +742,7 @@ const NSIG = 32;
742742
743743/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
744744pub const Sigaction = extern struct {
745 pub const handler_fn = std.meta.FnPtr(fn (i32) align(1) callconv(.C) void);
745 pub const handler_fn = *const fn (i32) align(1) callconv(.C) void;
746746
747747 /// signal handler
748748 __sigaction_u: extern union {
lib/std/c/linux.zig+1-1
......@@ -263,7 +263,7 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int;
263263/// See std.elf for constants for this
264264pub extern "c" fn getauxval(__type: c_ulong) c_ulong;
265265
266pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
266pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
267267
268268pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
269269
lib/std/c/netbsd.zig+3-3
......@@ -9,7 +9,7 @@ const rusage = std.c.rusage;
99extern "c" fn __errno() *c_int;
1010pub const _errno = __errno;
1111
12pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
12pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
1313pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1414
1515pub extern "c" fn _lwp_self() lwpid_t;
......@@ -971,8 +971,8 @@ pub const SIG = struct {
971971
972972/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
973973pub const Sigaction = extern struct {
974 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
975 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
974 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
975 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
976976
977977 /// signal handler
978978 handler: extern union {
lib/std/c/openbsd.zig+3-3
......@@ -7,7 +7,7 @@ const iovec_const = std.os.iovec_const;
77extern "c" fn __errno() *c_int;
88pub const _errno = __errno;
99
10pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
10pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
1111pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1212
1313pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
......@@ -1026,8 +1026,8 @@ pub const SIG = struct {
10261026
10271027/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
10281028pub const Sigaction = extern struct {
1029 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
1030 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
1029 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
1030 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
10311031
10321032 /// signal handler
10331033 handler: extern union {
lib/std/c/solaris.zig+3-3
......@@ -8,7 +8,7 @@ const timezone = std.c.timezone;
88extern "c" fn ___errno() *c_int;
99pub const _errno = ___errno;
1010
11pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int);
11pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int;
1212pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1313
1414pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
......@@ -952,8 +952,8 @@ pub const SIG = struct {
952952
953953/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
954954pub const Sigaction = extern struct {
955 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
956 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
955 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
956 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
957957
958958 /// signal options
959959 flags: c_uint,
lib/std/compress/deflate/compressor.zig+1-1
......@@ -254,7 +254,7 @@ pub fn Compressor(comptime WriterType: anytype) type {
254254
255255 // Inner writer wrapped in a HuffmanBitWriter
256256 hm_bw: hm_bw.HuffmanBitWriter(WriterType) = undefined,
257 bulk_hasher: std.meta.FnPtr(fn ([]u8, []u32) u32),
257 bulk_hasher: *const fn ([]u8, []u32) u32,
258258
259259 sync: bool, // requesting flush
260260 best_speed_enc: *fast.DeflateFast, // Encoder for best_speed
lib/std/compress/deflate/compressor_test.zig+2-1
......@@ -133,7 +133,8 @@ fn testToFromWithLevelAndLimit(level: deflate.Compression, input: []const u8, li
133133 try expect(read == input.len);
134134 try expect(mem.eql(u8, input, decompressed));
135135
136 if (builtin.zig_backend == .stage1) {
136 if (false) {
137 // TODO: this test has regressed
137138 try testSync(level, input);
138139 }
139140}
lib/std/compress/deflate/decompressor.zig+1-7
......@@ -334,7 +334,7 @@ pub fn Decompressor(comptime ReaderType: type) type {
334334
335335 // Next step in the decompression,
336336 // and decompression state.
337 step: std.meta.FnPtr(fn (*Self) Error!void),
337 step: *const fn (*Self) Error!void,
338338 step_state: DecompressorState,
339339 final: bool,
340340 err: ?Error,
......@@ -479,12 +479,6 @@ pub fn Decompressor(comptime ReaderType: type) type {
479479 }
480480
481481 pub fn close(self: *Self) ?Error {
482 if (@import("builtin").zig_backend == .stage1) {
483 if (self.err == Error.EndOfStreamWithNoError) {
484 return null;
485 }
486 return self.err;
487 }
488482 if (self.err == @as(?Error, error.EndOfStreamWithNoError)) {
489483 return null;
490484 }
lib/std/dwarf.zig+1-1
......@@ -638,7 +638,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en
638638 FORM.line_strp => FormValue{ .LineStrPtr = try readAddress(in_stream, endian, is_64) },
639639 FORM.indirect => {
640640 const child_form_id = try nosuspend leb.readULEB128(u64, in_stream);
641 if (builtin.zig_backend != .stage1) {
641 if (true) {
642642 return parseFormValue(allocator, in_stream, child_form_id, endian, is_64);
643643 }
644644 const F = @TypeOf(async parseFormValue(allocator, in_stream, child_form_id, endian, is_64));
lib/std/event/batch.zig+1-1
......@@ -109,7 +109,7 @@ pub fn Batch(
109109}
110110
111111test "std.event.Batch" {
112 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest;
112 if (true) return error.SkipZigTest;
113113 var count: usize = 0;
114114 var batch = Batch(void, 2, .auto_async).init();
115115 batch.add(&async sleepALittle(&count));
lib/std/event/loop.zig+1-1
......@@ -1469,7 +1469,7 @@ pub const Loop = struct {
14691469 .Cancelled => continue,
14701470 }
14711471 if (overlapped) |o| break o;
1472 } else unreachable; // TODO else unreachable should not be necessary
1472 };
14731473 const resume_node = @fieldParentPtr(ResumeNode, "overlapped", overlapped);
14741474 const handle = resume_node.handle;
14751475 const resume_node_id = resume_node.id;
lib/std/fmt.zig+1-39
......@@ -2209,7 +2209,7 @@ test "pointer" {
22092209 try expectFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value});
22102210 try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value});
22112211 }
2212 const FnPtr = if (builtin.zig_backend == .stage1) fn () void else *align(1) const fn () void;
2212 const FnPtr = *align(1) const fn () void;
22132213 {
22142214 const value = @intToPtr(FnPtr, 0xdeadbeef);
22152215 try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value});
......@@ -2266,10 +2266,6 @@ test "struct" {
22662266}
22672267
22682268test "enum" {
2269 if (builtin.zig_backend == .stage1) {
2270 // stage1 starts the typename with 'std' which might also be desireable for stage2
2271 return error.SkipZigTest;
2272 }
22732269 const Enum = enum {
22742270 One,
22752271 Two,
......@@ -2285,10 +2281,6 @@ test "enum" {
22852281}
22862282
22872283test "non-exhaustive enum" {
2288 if (builtin.zig_backend == .stage1) {
2289 // stage1 fails to return fully qualified namespaces.
2290 return error.SkipZigTest;
2291 }
22922284 const Enum = enum(u16) {
22932285 One = 0x000f,
22942286 Two = 0xbeef,
......@@ -2462,10 +2454,6 @@ test "custom" {
24622454}
24632455
24642456test "struct" {
2465 if (builtin.zig_backend == .stage1) {
2466 // stage1 fails to return fully qualified namespaces.
2467 return error.SkipZigTest;
2468 }
24692457 const S = struct {
24702458 a: u32,
24712459 b: anyerror,
......@@ -2484,10 +2472,6 @@ test "struct" {
24842472}
24852473
24862474test "union" {
2487 if (builtin.zig_backend == .stage1) {
2488 // stage1 fails to return fully qualified namespaces.
2489 return error.SkipZigTest;
2490 }
24912475 const TU = union(enum) {
24922476 float: f32,
24932477 int: u32,
......@@ -2518,10 +2502,6 @@ test "union" {
25182502}
25192503
25202504test "enum" {
2521 if (builtin.zig_backend == .stage1) {
2522 // stage1 fails to return fully qualified namespaces.
2523 return error.SkipZigTest;
2524 }
25252505 const E = enum {
25262506 One,
25272507 Two,
......@@ -2534,10 +2514,6 @@ test "enum" {
25342514}
25352515
25362516test "struct.self-referential" {
2537 if (builtin.zig_backend == .stage1) {
2538 // stage1 fails to return fully qualified namespaces.
2539 return error.SkipZigTest;
2540 }
25412517 const S = struct {
25422518 const SelfType = @This();
25432519 a: ?*SelfType,
......@@ -2552,10 +2528,6 @@ test "struct.self-referential" {
25522528}
25532529
25542530test "struct.zero-size" {
2555 if (builtin.zig_backend == .stage1) {
2556 // stage1 fails to return fully qualified namespaces.
2557 return error.SkipZigTest;
2558 }
25592531 const A = struct {
25602532 fn foo() void {}
25612533 };
......@@ -2633,10 +2605,6 @@ test "formatFloatValue with comptime_float" {
26332605}
26342606
26352607test "formatType max_depth" {
2636 if (builtin.zig_backend == .stage1) {
2637 // stage1 fails to return fully qualified namespaces.
2638 return error.SkipZigTest;
2639 }
26402608 const Vec2 = struct {
26412609 const SelfType = @This();
26422610 x: f32,
......@@ -2724,12 +2692,6 @@ test "vector" {
27242692 return error.SkipZigTest;
27252693 }
27262694
2727 if (builtin.zig_backend == .stage1) {
2728 // Regressed in LLVM 14:
2729 // https://github.com/llvm/llvm-project/issues/55522
2730 return error.SkipZigTest;
2731 }
2732
27332695 const vbool: @Vector(4, bool) = [_]bool{ true, false, true, false };
27342696 const vi64: @Vector(4, i64) = [_]i64{ -2, -1, 0, 1 };
27352697 const vu64: @Vector(4, u64) = [_]u64{ 1000, 2000, 3000, 4000 };
lib/std/fmt/parse_float.zig+1-3
......@@ -70,9 +70,7 @@ test "fmt.parseFloat" {
7070}
7171
7272test "fmt.parseFloat nan and inf" {
73 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
74 builtin.cpu.arch == .aarch64)
75 {
73 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
7674 // https://github.com/ziglang/zig/issues/12027
7775 return error.SkipZigTest;
7876 }
lib/std/json.zig+1-4
......@@ -2373,10 +2373,7 @@ pub fn stringifyAlloc(allocator: std.mem.Allocator, value: anytype, options: Str
23732373}
23742374
23752375test {
2376 if (builtin.zig_backend != .stage1) {
2377 // https://github.com/ziglang/zig/issues/8442
2378 _ = @import("json/test.zig");
2379 }
2376 _ = @import("json/test.zig");
23802377 _ = @import("json/write_stream.zig");
23812378}
23822379
lib/std/leb128.zig+2-6
......@@ -347,9 +347,7 @@ fn test_write_leb128(value: anytype) !void {
347347}
348348
349349test "serialize unsigned LEB128" {
350 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
351 builtin.cpu.arch == .riscv64)
352 {
350 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .riscv64) {
353351 // https://github.com/ziglang/zig/issues/12031
354352 return error.SkipZigTest;
355353 }
......@@ -368,9 +366,7 @@ test "serialize unsigned LEB128" {
368366}
369367
370368test "serialize signed LEB128" {
371 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
372 builtin.cpu.arch == .riscv64)
373 {
369 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .riscv64) {
374370 // https://github.com/ziglang/zig/issues/12031
375371 return error.SkipZigTest;
376372 }
lib/std/math.zig+5-13
......@@ -528,9 +528,7 @@ pub fn shl(comptime T: type, a: T, shift_amt: anytype) T {
528528}
529529
530530test "shl" {
531 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
532 builtin.cpu.arch == .aarch64)
533 {
531 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
534532 // https://github.com/ziglang/zig/issues/12012
535533 return error.SkipZigTest;
536534 }
......@@ -574,9 +572,7 @@ pub fn shr(comptime T: type, a: T, shift_amt: anytype) T {
574572}
575573
576574test "shr" {
577 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
578 builtin.cpu.arch == .aarch64)
579 {
575 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
580576 // https://github.com/ziglang/zig/issues/12012
581577 return error.SkipZigTest;
582578 }
......@@ -621,9 +617,7 @@ pub fn rotr(comptime T: type, x: T, r: anytype) T {
621617}
622618
623619test "rotr" {
624 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
625 builtin.cpu.arch == .aarch64)
626 {
620 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
627621 // https://github.com/ziglang/zig/issues/12012
628622 return error.SkipZigTest;
629623 }
......@@ -667,9 +661,7 @@ pub fn rotl(comptime T: type, x: T, r: anytype) T {
667661}
668662
669663test "rotl" {
670 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
671 builtin.cpu.arch == .aarch64)
672 {
664 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
673665 // https://github.com/ziglang/zig/issues/12012
674666 return error.SkipZigTest;
675667 }
......@@ -1695,7 +1687,7 @@ fn testSign() !void {
16951687}
16961688
16971689test "sign" {
1698 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {
1690 if (builtin.zig_backend == .stage2_llvm) {
16991691 // https://github.com/ziglang/zig/issues/12012
17001692 return error.SkipZigTest;
17011693 }
lib/std/mem.zig+1-7
......@@ -322,7 +322,7 @@ pub fn zeroes(comptime T: type) T {
322322}
323323
324324test "zeroes" {
325 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {
325 if (builtin.zig_backend == .stage2_llvm) {
326326 // Regressed in LLVM 14:
327327 // https://github.com/llvm/llvm-project/issues/55522
328328 return error.SkipZigTest;
......@@ -3187,8 +3187,6 @@ pub fn asBytes(ptr: anytype) AsBytesReturnType(@TypeOf(ptr)) {
31873187}
31883188
31893189test "asBytes" {
3190 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3191
31923190 const deadbeef = @as(u32, 0xDEADBEEF);
31933191 const deadbeef_bytes = switch (native_endian) {
31943192 .Big => "\xDE\xAD\xBE\xEF",
......@@ -3282,8 +3280,6 @@ pub fn bytesAsValue(comptime T: type, bytes: anytype) BytesAsValueReturnType(T,
32823280}
32833281
32843282test "bytesAsValue" {
3285 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3286
32873283 const deadbeef = @as(u32, 0xDEADBEEF);
32883284 const deadbeef_bytes = switch (native_endian) {
32893285 .Big => "\xDE\xAD\xBE\xEF",
......@@ -3485,8 +3481,6 @@ test "sliceAsBytes with sentinel slice" {
34853481}
34863482
34873483test "sliceAsBytes packed struct at runtime and comptime" {
3488 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3489
34903484 const Foo = packed struct {
34913485 a: u4,
34923486 b: u4,
lib/std/mem/Allocator.zig+3-3
......@@ -20,7 +20,7 @@ pub const VTable = struct {
2020 /// `ret_addr` is optionally provided as the first return address of the
2121 /// allocation call stack. If the value is `0` it means no return address
2222 /// has been provided.
23 alloc: std.meta.FnPtr(fn (ctx: *anyopaque, len: usize, ptr_align: u8, ret_addr: usize) ?[*]u8),
23 alloc: *const fn (ctx: *anyopaque, len: usize, ptr_align: u8, ret_addr: usize) ?[*]u8,
2424
2525 /// Attempt to expand or shrink memory in place. `buf.len` must equal the
2626 /// length requested from the most recent successful call to `alloc` or
......@@ -37,7 +37,7 @@ pub const VTable = struct {
3737 /// `ret_addr` is optionally provided as the first return address of the
3838 /// allocation call stack. If the value is `0` it means no return address
3939 /// has been provided.
40 resize: std.meta.FnPtr(fn (ctx: *anyopaque, buf: []u8, buf_align: u8, new_len: usize, ret_addr: usize) bool),
40 resize: *const fn (ctx: *anyopaque, buf: []u8, buf_align: u8, new_len: usize, ret_addr: usize) bool,
4141
4242 /// Free and invalidate a buffer.
4343 ///
......@@ -50,7 +50,7 @@ pub const VTable = struct {
5050 /// `ret_addr` is optionally provided as the first return address of the
5151 /// allocation call stack. If the value is `0` it means no return address
5252 /// has been provided.
53 free: std.meta.FnPtr(fn (ctx: *anyopaque, buf: []u8, buf_align: u8, ret_addr: usize) void),
53 free: *const fn (ctx: *anyopaque, buf: []u8, buf_align: u8, ret_addr: usize) void,
5454};
5555
5656pub fn noResize(
lib/std/meta.zig+2-34
......@@ -361,11 +361,7 @@ pub fn assumeSentinel(p: anytype, comptime sentinel_val: Elem(@TypeOf(p))) Senti
361361 const ReturnType = Sentinel(T, sentinel_val);
362362 switch (@typeInfo(T)) {
363363 .Pointer => |info| switch (info.size) {
364 .Slice => if (@import("builtin").zig_backend == .stage1)
365 return @bitCast(ReturnType, p)
366 else
367 return @ptrCast(ReturnType, p),
368 .Many, .One => return @ptrCast(ReturnType, p),
364 .Slice, .Many, .One => return @ptrCast(ReturnType, p),
369365 .C => {},
370366 },
371367 .Optional => |info| switch (@typeInfo(info.child)) {
......@@ -658,8 +654,6 @@ pub fn FieldEnum(comptime T: type) type {
658654 const field_infos = fields(T);
659655
660656 if (field_infos.len == 0) {
661 // TODO simplify when stage1 is removed
662 if (@import("builtin").zig_backend == .stage1) @compileError("stage1 doesn't allow empty enums");
663657 return @Type(.{
664658 .Enum = .{
665659 .layout = .Auto,
......@@ -742,9 +736,7 @@ fn expectEqualEnum(expected: anytype, actual: @TypeOf(expected)) !void {
742736}
743737
744738test "std.meta.FieldEnum" {
745 if (comptime @import("builtin").zig_backend != .stage1) {
746 try expectEqualEnum(enum {}, FieldEnum(struct {}));
747 }
739 try expectEqualEnum(enum {}, FieldEnum(struct {}));
748740 try expectEqualEnum(enum { a }, FieldEnum(struct { a: u8 }));
749741 try expectEqualEnum(enum { a, b, c }, FieldEnum(struct { a: u8, b: void, c: f32 }));
750742 try expectEqualEnum(enum { a, b, c }, FieldEnum(union { a: u8, b: void, c: f32 }));
......@@ -1239,27 +1231,3 @@ test "isError" {
12391231 try std.testing.expect(isError(math.absInt(@as(i8, -128))));
12401232 try std.testing.expect(!isError(math.absInt(@as(i8, -127))));
12411233}
1242
1243/// This function returns a function pointer for a given function signature.
1244/// It's a helper to make code compatible to both stage1 and stage2.
1245///
1246/// **WARNING:** This function is deprecated and will be removed together with stage1.
1247pub fn FnPtr(comptime Fn: type) type {
1248 return if (@import("builtin").zig_backend != .stage1)
1249 *const Fn
1250 else
1251 Fn;
1252}
1253
1254test "FnPtr" {
1255 var func: FnPtr(fn () i64) = undefined;
1256
1257 // verify that we can perform runtime exchange
1258 // and not have a function body in stage2:
1259
1260 func = std.time.timestamp;
1261 _ = func();
1262
1263 func = std.time.milliTimestamp;
1264 _ = func();
1265}
lib/std/multi_array_list.zig+3-4
......@@ -90,13 +90,12 @@ pub fn MultiArrayList(comptime S: type) type {
9090 };
9191 }
9292 const Sort = struct {
93 fn lessThan(trash: *i32, lhs: Data, rhs: Data) bool {
94 _ = trash;
93 fn lessThan(context: void, lhs: Data, rhs: Data) bool {
94 _ = context;
9595 return lhs.alignment > rhs.alignment;
9696 }
9797 };
98 var trash: i32 = undefined; // workaround for stage1 compiler bug
99 std.sort.sort(Data, &data, &trash, Sort.lessThan);
98 std.sort.sort(Data, &data, {}, Sort.lessThan);
10099 var sizes_bytes: [fields.len]usize = undefined;
101100 var field_indexes: [fields.len]usize = undefined;
102101 for (data) |elem, i| {
lib/std/os.zig+2-2
......@@ -3621,7 +3621,7 @@ pub fn accept(
36213621 else => |err| return unexpectedErrno(err),
36223622 }
36233623 }
3624 } else unreachable;
3624 };
36253625
36263626 if (!have_accept4) {
36273627 try setSockFlags(accepted_sock, flags);
......@@ -5360,7 +5360,7 @@ pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 {
53605360/// if this happens the fix is to add the error code to the corresponding
53615361/// switch expression, possibly introduce a new error in the error set, and
53625362/// send a patch to Zig.
5363pub const unexpected_error_tracing = (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and builtin.mode == .Debug;
5363pub const unexpected_error_tracing = builtin.zig_backend == .stage2_llvm and builtin.mode == .Debug;
53645364
53655365pub const UnexpectedError = error{
53665366 /// The Operating System returned an undocumented error code.
lib/std/os/linux.zig+15-34
......@@ -936,16 +936,10 @@ pub fn flock(fd: fd_t, operation: i32) usize {
936936 return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation)));
937937}
938938
939var vdso_clock_gettime = if (builtin.zig_backend == .stage1)
940 @ptrCast(?*const anyopaque, init_vdso_clock_gettime)
941else
942 @ptrCast(?*const anyopaque, &init_vdso_clock_gettime);
939var vdso_clock_gettime = @ptrCast(?*const anyopaque, &init_vdso_clock_gettime);
943940
944941// We must follow the C calling convention when we call into the VDSO
945const vdso_clock_gettime_ty = if (builtin.zig_backend == .stage1)
946 fn (i32, *timespec) callconv(.C) usize
947else
948 *align(1) const fn (i32, *timespec) callconv(.C) usize;
942const vdso_clock_gettime_ty = *align(1) const fn (i32, *timespec) callconv(.C) usize;
949943
950944pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {
951945 if (@hasDecl(VDSO, "CGT_SYM")) {
......@@ -1151,8 +1145,8 @@ pub fn sigaction(sig: u6, noalias act: ?*const Sigaction, noalias oact: ?*Sigact
11511145 const mask_size = @sizeOf(@TypeOf(ksa.mask));
11521146
11531147 if (act) |new| {
1154 const restore_rt_ptr = if (builtin.zig_backend == .stage1) restore_rt else &restore_rt;
1155 const restore_ptr = if (builtin.zig_backend == .stage1) restore else &restore;
1148 const restore_rt_ptr = &restore_rt;
1149 const restore_ptr = &restore;
11561150 const restorer_fn = if ((new.flags & SA.SIGINFO) != 0) restore_rt_ptr else restore_ptr;
11571151 ksa = k_sigaction{
11581152 .handler = new.handler.handler,
......@@ -3145,8 +3139,8 @@ pub const all_mask: sigset_t = [_]u32{0xffffffff} ** @typeInfo(sigset_t).Array.l
31453139pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30;
31463140
31473141const k_sigaction_funcs = struct {
3148 const handler = ?std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
3149 const restorer = std.meta.FnPtr(fn () callconv(.C) void);
3142 const handler = ?*const fn (c_int) align(1) callconv(.C) void;
3143 const restorer = *const fn () callconv(.C) void;
31503144};
31513145
31523146pub const k_sigaction = switch (native_arch) {
......@@ -3172,8 +3166,8 @@ pub const k_sigaction = switch (native_arch) {
31723166
31733167/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
31743168pub const Sigaction = extern struct {
3175 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);
3176 pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void);
3169 pub const handler_fn = *const fn (c_int) align(1) callconv(.C) void;
3170 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
31773171
31783172 handler: extern union {
31793173 handler: ?handler_fn,
......@@ -3181,7 +3175,7 @@ pub const Sigaction = extern struct {
31813175 },
31823176 mask: sigset_t,
31833177 flags: c_uint,
3184 restorer: ?std.meta.FnPtr(fn () callconv(.C) void) = null,
3178 restorer: ?*const fn () callconv(.C) void = null,
31853179};
31863180
31873181pub const empty_sigset = [_]u32{0} ** @typeInfo(sigset_t).Array.len;
......@@ -3314,25 +3308,12 @@ pub const epoll_data = extern union {
33143308 u64: u64,
33153309};
33163310
3317pub const epoll_event = switch (builtin.zig_backend) {
3318 // stage1 crashes with the align(4) field so we have this workaround
3319 .stage1 => switch (native_arch) {
3320 .x86_64 => packed struct {
3321 events: u32,
3322 data: epoll_data,
3323 },
3324 else => extern struct {
3325 events: u32,
3326 data: epoll_data,
3327 },
3328 },
3329 else => extern struct {
3330 events: u32,
3331 data: epoll_data align(switch (native_arch) {
3332 .x86_64 => 4,
3333 else => @alignOf(epoll_data),
3334 }),
3335 },
3311pub const epoll_event = extern struct {
3312 events: u32,
3313 data: epoll_data align(switch (native_arch) {
3314 .x86_64 => 4,
3315 else => @alignOf(epoll_data),
3316 }),
33363317};
33373318
33383319pub const VFS_CAP_REVISION_MASK = 0xFF000000;
lib/std/os/linux/arm-eabi.zig+1-1
......@@ -98,7 +98,7 @@ pub fn syscall6(
9898 );
9999}
100100
101const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
101const CloneFn = *const fn (arg: usize) callconv(.C) u8;
102102
103103/// This matches the libc clone function.
104104pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/arm64.zig+1-1
......@@ -98,7 +98,7 @@ pub fn syscall6(
9898 );
9999}
100100
101const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
101const CloneFn = *const fn (arg: usize) callconv(.C) u8;
102102
103103/// This matches the libc clone function.
104104pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/mips.zig+1-1
......@@ -190,7 +190,7 @@ pub fn syscall7(
190190 );
191191}
192192
193const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
193const CloneFn = *const fn (arg: usize) callconv(.C) u8;
194194
195195/// This matches the libc clone function.
196196pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/powerpc.zig+1-1
......@@ -126,7 +126,7 @@ pub fn syscall6(
126126 );
127127}
128128
129const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
129const CloneFn = *const fn (arg: usize) callconv(.C) u8;
130130
131131/// This matches the libc clone function.
132132pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/powerpc64.zig+1-1
......@@ -126,7 +126,7 @@ pub fn syscall6(
126126 );
127127}
128128
129const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
129const CloneFn = *const fn (arg: usize) callconv(.C) u8;
130130
131131/// This matches the libc clone function.
132132pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/riscv64.zig+1-1
......@@ -95,7 +95,7 @@ pub fn syscall6(
9595 );
9696}
9797
98const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
98const CloneFn = *const fn (arg: usize) callconv(.C) u8;
9999
100100pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
101101
lib/std/os/linux/sparc64.zig+1-1
......@@ -178,7 +178,7 @@ pub fn syscall6(
178178 );
179179}
180180
181const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
181const CloneFn = *const fn (arg: usize) callconv(.C) u8;
182182
183183/// This matches the libc clone function.
184184pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/x86.zig+1-1
......@@ -118,7 +118,7 @@ pub fn socketcall(call: usize, args: [*]usize) usize {
118118 );
119119}
120120
121const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
121const CloneFn = *const fn (arg: usize) callconv(.C) u8;
122122
123123/// This matches the libc clone function.
124124pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/linux/x86_64.zig+1-1
......@@ -100,7 +100,7 @@ pub fn syscall6(
100100 );
101101}
102102
103const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);
103const CloneFn = *const fn (arg: usize) callconv(.C) u8;
104104
105105/// This matches the libc clone function.
106106pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
lib/std/os/test.zig+2-4
......@@ -785,10 +785,8 @@ test "sigaction" {
785785 }
786786 };
787787
788 const actual_handler = if (builtin.zig_backend == .stage1) S.handler else &S.handler;
789
790788 var sa = os.Sigaction{
791 .handler = .{ .sigaction = actual_handler },
789 .handler = .{ .sigaction = &S.handler },
792790 .mask = os.empty_sigset,
793791 .flags = os.SA.SIGINFO | os.SA.RESETHAND,
794792 };
......@@ -799,7 +797,7 @@ test "sigaction" {
799797
800798 // Check that we can read it back correctly.
801799 try os.sigaction(os.SIG.USR1, null, &old_sa);
802 try testing.expectEqual(actual_handler, old_sa.handler.sigaction.?);
800 try testing.expectEqual(&S.handler, old_sa.handler.sigaction.?);
803801 try testing.expect((old_sa.flags & os.SA.SIGINFO) != 0);
804802
805803 // Invoke the handler.
lib/std/os/uefi/protocols/absolute_pointer_protocol.zig+2-2
......@@ -6,8 +6,8 @@ const Status = uefi.Status;
66
77/// Protocol for touchscreens
88pub const AbsolutePointerProtocol = extern struct {
9 _reset: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status),
10 _get_state: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status),
9 _reset: *const fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status,
10 _get_state: *const fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status,
1111 wait_for_input: Event,
1212 mode: *AbsolutePointerMode,
1313
lib/std/os/uefi/protocols/block_io_protocol.zig+4-4
......@@ -44,10 +44,10 @@ pub const BlockIoProtocol = extern struct {
4444 revision: u64,
4545 media: *EfiBlockMedia,
4646
47 _reset: std.meta.FnPtr(fn (*BlockIoProtocol, extended_verification: bool) callconv(.C) Status),
48 _read_blocks: std.meta.FnPtr(fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status),
49 _write_blocks: std.meta.FnPtr(fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status),
50 _flush_blocks: std.meta.FnPtr(fn (*BlockIoProtocol) callconv(.C) Status),
47 _reset: *const fn (*BlockIoProtocol, extended_verification: bool) callconv(.C) Status,
48 _read_blocks: *const fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status,
49 _write_blocks: *const fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status,
50 _flush_blocks: *const fn (*BlockIoProtocol) callconv(.C) Status,
5151
5252 /// Resets the block device hardware.
5353 pub fn reset(self: *Self, extended_verification: bool) Status {
lib/std/os/uefi/protocols/edid_override_protocol.zig+1-1
......@@ -6,7 +6,7 @@ const Status = uefi.Status;
66
77/// Override EDID information
88pub const EdidOverrideProtocol = extern struct {
9 _get_edid: std.meta.FnPtr(fn (*const EdidOverrideProtocol, Handle, *EdidOverrideProtocolAttributes, *usize, *?[*]u8) callconv(.C) Status),
9 _get_edid: *const fn (*const EdidOverrideProtocol, Handle, *EdidOverrideProtocolAttributes, *usize, *?[*]u8) callconv(.C) Status,
1010
1111 /// Returns policy information and potentially a replacement EDID for the specified video output device.
1212 pub fn getEdid(
lib/std/os/uefi/protocols/file_protocol.zig+10-10
......@@ -7,16 +7,16 @@ const Status = uefi.Status;
77
88pub const FileProtocol = extern struct {
99 revision: u64,
10 _open: std.meta.FnPtr(fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status),
11 _close: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),
12 _delete: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),
13 _read: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status),
14 _write: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status),
15 _get_position: std.meta.FnPtr(fn (*const FileProtocol, *u64) callconv(.C) Status),
16 _set_position: std.meta.FnPtr(fn (*const FileProtocol, u64) callconv(.C) Status),
17 _get_info: std.meta.FnPtr(fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status),
18 _set_info: std.meta.FnPtr(fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status),
19 _flush: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),
10 _open: *const fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status,
11 _close: *const fn (*const FileProtocol) callconv(.C) Status,
12 _delete: *const fn (*const FileProtocol) callconv(.C) Status,
13 _read: *const fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status,
14 _write: *const fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status,
15 _get_position: *const fn (*const FileProtocol, *u64) callconv(.C) Status,
16 _set_position: *const fn (*const FileProtocol, u64) callconv(.C) Status,
17 _get_info: *const fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status,
18 _set_info: *const fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status,
19 _flush: *const fn (*const FileProtocol) callconv(.C) Status,
2020
2121 pub const SeekError = error{SeekError};
2222 pub const GetSeekPosError = error{GetSeekPosError};
lib/std/os/uefi/protocols/graphics_output_protocol.zig+3-3
......@@ -5,9 +5,9 @@ const Status = uefi.Status;
55
66/// Graphics output
77pub const GraphicsOutputProtocol = extern struct {
8 _query_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status),
9 _set_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status),
10 _blt: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status),
8 _query_mode: *const fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status,
9 _set_mode: *const fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status,
10 _blt: *const fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status,
1111 mode: *GraphicsOutputProtocolMode,
1212
1313 /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports.
lib/std/os/uefi/protocols/hii_database_protocol.zig+4-4
......@@ -7,10 +7,10 @@ const hii = uefi.protocols.hii;
77/// Database manager for HII-related data structures.
88pub const HIIDatabaseProtocol = extern struct {
99 _new_package_list: Status, // TODO
10 _remove_package_list: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status),
11 _update_package_list: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) callconv(.C) Status),
12 _list_package_lists: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) callconv(.C) Status),
13 _export_package_lists: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status),
10 _remove_package_list: *const fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status,
11 _update_package_list: *const fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) callconv(.C) Status,
12 _list_package_lists: *const fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) callconv(.C) Status,
13 _export_package_lists: *const fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status,
1414 _register_package_notify: Status, // TODO
1515 _unregister_package_notify: Status, // TODO
1616 _find_keyboard_layouts: Status, // TODO
lib/std/os/uefi/protocols/hii_popup_protocol.zig+1-1
......@@ -7,7 +7,7 @@ const hii = uefi.protocols.hii;
77/// Display a popup window
88pub const HIIPopupProtocol = extern struct {
99 revision: u64,
10 _create_popup: std.meta.FnPtr(fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) callconv(.C) Status),
10 _create_popup: *const fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) callconv(.C) Status,
1111
1212 /// Displays a popup window.
1313 pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) Status {
lib/std/os/uefi/protocols/ip6_config_protocol.zig+4-4
......@@ -5,10 +5,10 @@ const Event = uefi.Event;
55const Status = uefi.Status;
66
77pub const Ip6ConfigProtocol = extern struct {
8 _set_data: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status),
9 _get_data: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const anyopaque) callconv(.C) Status),
10 _register_data_notify: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status),
11 _unregister_data_notify: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status),
8 _set_data: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status,
9 _get_data: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const anyopaque) callconv(.C) Status,
10 _register_data_notify: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
11 _unregister_data_notify: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
1212
1313 pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const anyopaque) Status {
1414 return self._set_data(self, data_type, data_size, data);
lib/std/os/uefi/protocols/ip6_protocol.zig+9-9
......@@ -8,15 +8,15 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
88const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
99
1010pub const Ip6Protocol = extern struct {
11 _get_mode_data: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),
12 _configure: std.meta.FnPtr(fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status),
13 _groups: std.meta.FnPtr(fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status),
14 _routes: std.meta.FnPtr(fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) callconv(.C) Status),
15 _neighbors: std.meta.FnPtr(fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) callconv(.C) Status),
16 _transmit: std.meta.FnPtr(fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status),
17 _receive: std.meta.FnPtr(fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status),
18 _cancel: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status),
19 _poll: std.meta.FnPtr(fn (*const Ip6Protocol) callconv(.C) Status),
11 _get_mode_data: *const fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
12 _configure: *const fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status,
13 _groups: *const fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status,
14 _routes: *const fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) callconv(.C) Status,
15 _neighbors: *const fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) callconv(.C) Status,
16 _transmit: *const fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
17 _receive: *const fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
18 _cancel: *const fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status,
19 _poll: *const fn (*const Ip6Protocol) callconv(.C) Status,
2020
2121 /// Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.
2222 pub fn getModeData(self: *const Ip6Protocol, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {
lib/std/os/uefi/protocols/ip6_service_binding_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
55const Status = uefi.Status;
66
77pub const Ip6ServiceBindingProtocol = extern struct {
8 _create_child: std.meta.FnPtr(fn (*const Ip6ServiceBindingProtocol, *?Handle) callconv(.C) Status),
9 _destroy_child: std.meta.FnPtr(fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status),
8 _create_child: *const fn (*const Ip6ServiceBindingProtocol, *?Handle) callconv(.C) Status,
9 _destroy_child: *const fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status,
1010
1111 pub fn createChild(self: *const Ip6ServiceBindingProtocol, handle: *?Handle) Status {
1212 return self._create_child(self, handle);
lib/std/os/uefi/protocols/loaded_image_protocol.zig+1-1
......@@ -20,7 +20,7 @@ pub const LoadedImageProtocol = extern struct {
2020 image_size: u64,
2121 image_code_type: MemoryType,
2222 image_data_type: MemoryType,
23 _unload: std.meta.FnPtr(fn (*const LoadedImageProtocol, Handle) callconv(.C) Status),
23 _unload: *const fn (*const LoadedImageProtocol, Handle) callconv(.C) Status,
2424
2525 /// Unloads an image from memory.
2626 pub fn unload(self: *const LoadedImageProtocol, handle: Handle) Status {
lib/std/os/uefi/protocols/managed_network_protocol.zig+8-8
......@@ -8,14 +8,14 @@ const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
88const MacAddress = uefi.protocols.MacAddress;
99
1010pub const ManagedNetworkProtocol = extern struct {
11 _get_mode_data: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),
12 _configure: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status),
13 _mcast_ip_to_mac: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status),
14 _groups: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status),
15 _transmit: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),
16 _receive: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),
17 _cancel: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status),
18 _poll: std.meta.FnPtr(fn (*const ManagedNetworkProtocol) callconv(.C) Status),
11 _get_mode_data: *const fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
12 _configure: *const fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status,
13 _mcast_ip_to_mac: *const fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status,
14 _groups: *const fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
15 _transmit: *const fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
16 _receive: *const fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
17 _cancel: *const fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status,
18 _poll: *const fn (*const ManagedNetworkProtocol) callconv(.C) Status,
1919
2020 /// Returns the operational parameters for the current MNP child driver.
2121 /// May also support returning the underlying SNP driver mode data.
lib/std/os/uefi/protocols/managed_network_service_binding_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
55const Status = uefi.Status;
66
77pub const ManagedNetworkServiceBindingProtocol = extern struct {
8 _create_child: std.meta.FnPtr(fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) callconv(.C) Status),
9 _destroy_child: std.meta.FnPtr(fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status),
8 _create_child: *const fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) callconv(.C) Status,
9 _destroy_child: *const fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status,
1010
1111 pub fn createChild(self: *const ManagedNetworkServiceBindingProtocol, handle: *?Handle) Status {
1212 return self._create_child(self, handle);
lib/std/os/uefi/protocols/rng_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Status = uefi.Status;
55
66/// Random Number Generator protocol
77pub const RNGProtocol = extern struct {
8 _get_info: std.meta.FnPtr(fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status),
9 _get_rng: std.meta.FnPtr(fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status),
8 _get_info: *const fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status,
9 _get_rng: *const fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status,
1010
1111 /// Returns information about the random number generation implementation.
1212 pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) Status {
lib/std/os/uefi/protocols/simple_file_system_protocol.zig+1-1
......@@ -6,7 +6,7 @@ const Status = uefi.Status;
66
77pub const SimpleFileSystemProtocol = extern struct {
88 revision: u64,
9 _open_volume: std.meta.FnPtr(fn (*const SimpleFileSystemProtocol, **const FileProtocol) callconv(.C) Status),
9 _open_volume: *const fn (*const SimpleFileSystemProtocol, **const FileProtocol) callconv(.C) Status,
1010
1111 pub fn openVolume(self: *const SimpleFileSystemProtocol, root: **const FileProtocol) Status {
1212 return self._open_volume(self, root);
lib/std/os/uefi/protocols/simple_network_protocol.zig+13-13
......@@ -6,19 +6,19 @@ const Status = uefi.Status;
66
77pub const SimpleNetworkProtocol = extern struct {
88 revision: u64,
9 _start: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),
10 _stop: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),
11 _initialize: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status),
12 _reset: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status),
13 _shutdown: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),
14 _receive_filters: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status),
15 _station_address: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status),
16 _statistics: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status),
17 _mcast_ip_to_mac: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status),
18 _nvdata: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status),
19 _get_status: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status),
20 _transmit: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status),
21 _receive: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status),
9 _start: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
10 _stop: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
11 _initialize: *const fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status,
12 _reset: *const fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status,
13 _shutdown: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
14 _receive_filters: *const fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status,
15 _station_address: *const fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
16 _statistics: *const fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status,
17 _mcast_ip_to_mac: *const fn (*const SimpleNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status,
18 _nvdata: *const fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status,
19 _get_status: *const fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status,
20 _transmit: *const fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status,
21 _receive: *const fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status,
2222 wait_for_packet: Event,
2323 mode: *SimpleNetworkMode,
2424
lib/std/os/uefi/protocols/simple_pointer_protocol.zig+2-2
......@@ -6,8 +6,8 @@ const Status = uefi.Status;
66
77/// Protocol for mice
88pub const SimplePointerProtocol = struct {
9 _reset: std.meta.FnPtr(fn (*const SimplePointerProtocol, bool) callconv(.C) Status),
10 _get_state: std.meta.FnPtr(fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status),
9 _reset: *const fn (*const SimplePointerProtocol, bool) callconv(.C) Status,
10 _get_state: *const fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status,
1111 wait_for_input: Event,
1212 mode: *SimplePointerMode,
1313
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+6-6
......@@ -6,12 +6,12 @@ const Status = uefi.Status;
66
77/// Character input devices, e.g. Keyboard
88pub const SimpleTextInputExProtocol = extern struct {
9 _reset: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status),
10 _read_key_stroke_ex: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status),
9 _reset: *const fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status,
10 _read_key_stroke_ex: *const fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status,
1111 wait_for_key_ex: Event,
12 _set_state: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status),
13 _register_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const KeyData, std.meta.FnPtr(fn (*const KeyData) callconv(.C) usize), **anyopaque) callconv(.C) Status),
14 _unregister_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status),
12 _set_state: *const fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status,
13 _register_key_notify: *const fn (*const SimpleTextInputExProtocol, *const KeyData, *const fn (*const KeyData) callconv(.C) usize, **anyopaque) callconv(.C) Status,
14 _unregister_key_notify: *const fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status,
1515
1616 /// Resets the input device hardware.
1717 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status {
......@@ -29,7 +29,7 @@ pub const SimpleTextInputExProtocol = extern struct {
2929 }
3030
3131 /// Register a notification function for a particular keystroke for the input device.
32 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: std.meta.FnPtr(fn (*const KeyData) callconv(.C) usize), handle: **anyopaque) Status {
32 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: *const fn (*const KeyData) callconv(.C) usize, handle: **anyopaque) Status {
3333 return self._register_key_notify(self, key_data, notify, handle);
3434 }
3535
lib/std/os/uefi/protocols/simple_text_input_protocol.zig+2-2
......@@ -7,8 +7,8 @@ const Status = uefi.Status;
77
88/// Character input devices, e.g. Keyboard
99pub const SimpleTextInputProtocol = extern struct {
10 _reset: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status),
11 _read_key_stroke: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status),
10 _reset: *const fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status,
11 _read_key_stroke: *const fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status,
1212 wait_for_key: Event,
1313
1414 /// Resets the input device hardware.
lib/std/os/uefi/protocols/simple_text_output_protocol.zig+9-9
......@@ -5,15 +5,15 @@ const Status = uefi.Status;
55
66/// Character output devices
77pub const SimpleTextOutputProtocol = extern struct {
8 _reset: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status),
9 _output_string: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status),
10 _test_string: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status),
11 _query_mode: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status),
12 _set_mode: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status),
13 _set_attribute: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status),
14 _clear_screen: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol) callconv(.C) Status),
15 _set_cursor_position: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status),
16 _enable_cursor: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status),
8 _reset: *const fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
9 _output_string: *const fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status,
10 _test_string: *const fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status,
11 _query_mode: *const fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status,
12 _set_mode: *const fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
13 _set_attribute: *const fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
14 _clear_screen: *const fn (*const SimpleTextOutputProtocol) callconv(.C) Status,
15 _set_cursor_position: *const fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status,
16 _enable_cursor: *const fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
1717 mode: *SimpleTextOutputMode,
1818
1919 /// Resets the text output device hardware.
lib/std/os/uefi/protocols/udp6_protocol.zig+7-7
......@@ -10,13 +10,13 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
1010const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
1111
1212pub const Udp6Protocol = extern struct {
13 _get_mode_data: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),
14 _configure: std.meta.FnPtr(fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status),
15 _groups: std.meta.FnPtr(fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status),
16 _transmit: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status),
17 _receive: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status),
18 _cancel: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status),
19 _poll: std.meta.FnPtr(fn (*const Udp6Protocol) callconv(.C) Status),
13 _get_mode_data: *const fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
14 _configure: *const fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status,
15 _groups: *const fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status,
16 _transmit: *const fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
17 _receive: *const fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
18 _cancel: *const fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status,
19 _poll: *const fn (*const Udp6Protocol) callconv(.C) Status,
2020
2121 pub fn getModeData(self: *const Udp6Protocol, udp6_config_data: ?*Udp6ConfigData, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {
2222 return self._get_mode_data(self, udp6_config_data, ip6_mode_data, mnp_config_data, snp_mode_data);
lib/std/os/uefi/protocols/udp6_service_binding_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
55const Status = uefi.Status;
66
77pub const Udp6ServiceBindingProtocol = extern struct {
8 _create_child: std.meta.FnPtr(fn (*const Udp6ServiceBindingProtocol, *?Handle) callconv(.C) Status),
9 _destroy_child: std.meta.FnPtr(fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status),
8 _create_child: *const fn (*const Udp6ServiceBindingProtocol, *?Handle) callconv(.C) Status,
9 _destroy_child: *const fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status,
1010
1111 pub fn createChild(self: *const Udp6ServiceBindingProtocol, handle: *?Handle) Status {
1212 return self._create_child(self, handle);
lib/std/os/uefi/tables/boot_services.zig+44-44
......@@ -22,138 +22,138 @@ pub const BootServices = extern struct {
2222 hdr: TableHeader,
2323
2424 /// Raises a task's priority level and returns its previous level.
25 raiseTpl: std.meta.FnPtr(fn (new_tpl: usize) callconv(.C) usize),
25 raiseTpl: *const fn (new_tpl: usize) callconv(.C) usize,
2626
2727 /// Restores a task's priority level to its previous value.
28 restoreTpl: std.meta.FnPtr(fn (old_tpl: usize) callconv(.C) void),
28 restoreTpl: *const fn (old_tpl: usize) callconv(.C) void,
2929
3030 /// Allocates memory pages from the system.
31 allocatePages: std.meta.FnPtr(fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(.C) Status),
31 allocatePages: *const fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(.C) Status,
3232
3333 /// Frees memory pages.
34 freePages: std.meta.FnPtr(fn (memory: [*]align(4096) u8, pages: usize) callconv(.C) Status),
34 freePages: *const fn (memory: [*]align(4096) u8, pages: usize) callconv(.C) Status,
3535
3636 /// Returns the current memory map.
37 getMemoryMap: std.meta.FnPtr(fn (mmap_size: *usize, mmap: ?[*]MemoryDescriptor, mapKey: *usize, descriptor_size: *usize, descriptor_version: *u32) callconv(.C) Status),
37 getMemoryMap: *const fn (mmap_size: *usize, mmap: ?[*]MemoryDescriptor, mapKey: *usize, descriptor_size: *usize, descriptor_version: *u32) callconv(.C) Status,
3838
3939 /// Allocates pool memory.
40 allocatePool: std.meta.FnPtr(fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(.C) Status),
40 allocatePool: *const fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(.C) Status,
4141
4242 /// Returns pool memory to the system.
43 freePool: std.meta.FnPtr(fn (buffer: [*]align(8) u8) callconv(.C) Status),
43 freePool: *const fn (buffer: [*]align(8) u8) callconv(.C) Status,
4444
4545 /// Creates an event.
46 createEvent: std.meta.FnPtr(fn (type: u32, notify_tpl: usize, notify_func: ?std.meta.FnPtr(fn (Event, ?*anyopaque) callconv(.C) void), notifyCtx: ?*const anyopaque, event: *Event) callconv(.C) Status),
46 createEvent: *const fn (type: u32, notify_tpl: usize, notify_func: ?*const fn (Event, ?*anyopaque) callconv(.C) void, notifyCtx: ?*const anyopaque, event: *Event) callconv(.C) Status,
4747
4848 /// Sets the type of timer and the trigger time for a timer event.
49 setTimer: std.meta.FnPtr(fn (event: Event, type: TimerDelay, triggerTime: u64) callconv(.C) Status),
49 setTimer: *const fn (event: Event, type: TimerDelay, triggerTime: u64) callconv(.C) Status,
5050
5151 /// Stops execution until an event is signaled.
52 waitForEvent: std.meta.FnPtr(fn (event_len: usize, events: [*]const Event, index: *usize) callconv(.C) Status),
52 waitForEvent: *const fn (event_len: usize, events: [*]const Event, index: *usize) callconv(.C) Status,
5353
5454 /// Signals an event.
55 signalEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status),
55 signalEvent: *const fn (event: Event) callconv(.C) Status,
5656
5757 /// Closes an event.
58 closeEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status),
58 closeEvent: *const fn (event: Event) callconv(.C) Status,
5959
6060 /// Checks whether an event is in the signaled state.
61 checkEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status),
61 checkEvent: *const fn (event: Event) callconv(.C) Status,
6262
6363 /// Installs a protocol interface on a device handle. If the handle does not exist, it is created
6464 /// and added to the list of handles in the system. installMultipleProtocolInterfaces()
6565 /// performs more error checking than installProtocolInterface(), so its use is recommended over this.
66 installProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface_type: EfiInterfaceType, interface: *anyopaque) callconv(.C) Status),
66 installProtocolInterface: *const fn (handle: Handle, protocol: *align(8) const Guid, interface_type: EfiInterfaceType, interface: *anyopaque) callconv(.C) Status,
6767
6868 /// Reinstalls a protocol interface on a device handle
69 reinstallProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, old_interface: *anyopaque, new_interface: *anyopaque) callconv(.C) Status),
69 reinstallProtocolInterface: *const fn (handle: Handle, protocol: *align(8) const Guid, old_interface: *anyopaque, new_interface: *anyopaque) callconv(.C) Status,
7070
7171 /// Removes a protocol interface from a device handle. Usage of
7272 /// uninstallMultipleProtocolInterfaces is recommended over this.
73 uninstallProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *anyopaque) callconv(.C) Status),
73 uninstallProtocolInterface: *const fn (handle: Handle, protocol: *align(8) const Guid, interface: *anyopaque) callconv(.C) Status,
7474
7575 /// Queries a handle to determine if it supports a specified protocol.
76 handleProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque) callconv(.C) Status),
76 handleProtocol: *const fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque) callconv(.C) Status,
7777
7878 reserved: *anyopaque,
7979
8080 /// Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
81 registerProtocolNotify: std.meta.FnPtr(fn (protocol: *align(8) const Guid, event: Event, registration: **anyopaque) callconv(.C) Status),
81 registerProtocolNotify: *const fn (protocol: *align(8) const Guid, event: Event, registration: **anyopaque) callconv(.C) Status,
8282
8383 /// Returns an array of handles that support a specified protocol.
84 locateHandle: std.meta.FnPtr(fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, bufferSize: *usize, buffer: [*]Handle) callconv(.C) Status),
84 locateHandle: *const fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, bufferSize: *usize, buffer: [*]Handle) callconv(.C) Status,
8585
8686 /// Locates the handle to a device on the device path that supports the specified protocol
87 locateDevicePath: std.meta.FnPtr(fn (protocols: *align(8) const Guid, device_path: **const DevicePathProtocol, device: *?Handle) callconv(.C) Status),
87 locateDevicePath: *const fn (protocols: *align(8) const Guid, device_path: **const DevicePathProtocol, device: *?Handle) callconv(.C) Status,
8888
8989 /// Adds, updates, or removes a configuration table entry from the EFI System Table.
90 installConfigurationTable: std.meta.FnPtr(fn (guid: *align(8) const Guid, table: ?*anyopaque) callconv(.C) Status),
90 installConfigurationTable: *const fn (guid: *align(8) const Guid, table: ?*anyopaque) callconv(.C) Status,
9191
9292 /// Loads an EFI image into memory.
93 loadImage: std.meta.FnPtr(fn (boot_policy: bool, parent_image_handle: Handle, device_path: ?*const DevicePathProtocol, source_buffer: ?[*]const u8, source_size: usize, imageHandle: *?Handle) callconv(.C) Status),
93 loadImage: *const fn (boot_policy: bool, parent_image_handle: Handle, device_path: ?*const DevicePathProtocol, source_buffer: ?[*]const u8, source_size: usize, imageHandle: *?Handle) callconv(.C) Status,
9494
9595 /// Transfers control to a loaded image's entry point.
96 startImage: std.meta.FnPtr(fn (image_handle: Handle, exit_data_size: ?*usize, exit_data: ?*[*]u16) callconv(.C) Status),
96 startImage: *const fn (image_handle: Handle, exit_data_size: ?*usize, exit_data: ?*[*]u16) callconv(.C) Status,
9797
9898 /// Terminates a loaded EFI image and returns control to boot services.
99 exit: std.meta.FnPtr(fn (image_handle: Handle, exit_status: Status, exit_data_size: usize, exit_data: ?*const anyopaque) callconv(.C) Status),
99 exit: *const fn (image_handle: Handle, exit_status: Status, exit_data_size: usize, exit_data: ?*const anyopaque) callconv(.C) Status,
100100
101101 /// Unloads an image.
102 unloadImage: std.meta.FnPtr(fn (image_handle: Handle) callconv(.C) Status),
102 unloadImage: *const fn (image_handle: Handle) callconv(.C) Status,
103103
104104 /// Terminates all boot services.
105 exitBootServices: std.meta.FnPtr(fn (image_handle: Handle, map_key: usize) callconv(.C) Status),
105 exitBootServices: *const fn (image_handle: Handle, map_key: usize) callconv(.C) Status,
106106
107107 /// Returns a monotonically increasing count for the platform.
108 getNextMonotonicCount: std.meta.FnPtr(fn (count: *u64) callconv(.C) Status),
108 getNextMonotonicCount: *const fn (count: *u64) callconv(.C) Status,
109109
110110 /// Induces a fine-grained stall.
111 stall: std.meta.FnPtr(fn (microseconds: usize) callconv(.C) Status),
111 stall: *const fn (microseconds: usize) callconv(.C) Status,
112112
113113 /// Sets the system's watchdog timer.
114 setWatchdogTimer: std.meta.FnPtr(fn (timeout: usize, watchdogCode: u64, data_size: usize, watchdog_data: ?[*]const u16) callconv(.C) Status),
114 setWatchdogTimer: *const fn (timeout: usize, watchdogCode: u64, data_size: usize, watchdog_data: ?[*]const u16) callconv(.C) Status,
115115
116116 /// Connects one or more drives to a controller.
117 connectController: std.meta.FnPtr(fn (controller_handle: Handle, driver_image_handle: ?Handle, remaining_device_path: ?*DevicePathProtocol, recursive: bool) callconv(.C) Status),
117 connectController: *const fn (controller_handle: Handle, driver_image_handle: ?Handle, remaining_device_path: ?*DevicePathProtocol, recursive: bool) callconv(.C) Status,
118118
119119 // Disconnects one or more drivers from a controller
120 disconnectController: std.meta.FnPtr(fn (controller_handle: Handle, driver_image_handle: ?Handle, child_handle: ?Handle) callconv(.C) Status),
120 disconnectController: *const fn (controller_handle: Handle, driver_image_handle: ?Handle, child_handle: ?Handle) callconv(.C) Status,
121121
122122 /// Queries a handle to determine if it supports a specified protocol.
123 openProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque, agent_handle: ?Handle, controller_handle: ?Handle, attributes: OpenProtocolAttributes) callconv(.C) Status),
123 openProtocol: *const fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque, agent_handle: ?Handle, controller_handle: ?Handle, attributes: OpenProtocolAttributes) callconv(.C) Status,
124124
125125 /// Closes a protocol on a handle that was opened using openProtocol().
126 closeProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, agentHandle: Handle, controller_handle: ?Handle) callconv(.C) Status),
126 closeProtocol: *const fn (handle: Handle, protocol: *align(8) const Guid, agentHandle: Handle, controller_handle: ?Handle) callconv(.C) Status,
127127
128128 /// Retrieves the list of agents that currently have a protocol interface opened.
129 openProtocolInformation: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, entry_buffer: *[*]ProtocolInformationEntry, entry_count: *usize) callconv(.C) Status),
129 openProtocolInformation: *const fn (handle: Handle, protocol: *align(8) const Guid, entry_buffer: *[*]ProtocolInformationEntry, entry_count: *usize) callconv(.C) Status,
130130
131131 /// Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.
132 protocolsPerHandle: std.meta.FnPtr(fn (handle: Handle, protocol_buffer: *[*]*align(8) const Guid, protocol_buffer_count: *usize) callconv(.C) Status),
132 protocolsPerHandle: *const fn (handle: Handle, protocol_buffer: *[*]*align(8) const Guid, protocol_buffer_count: *usize) callconv(.C) Status,
133133
134134 /// Returns an array of handles that support the requested protocol in a buffer allocated from pool.
135 locateHandleBuffer: std.meta.FnPtr(fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, num_handles: *usize, buffer: *[*]Handle) callconv(.C) Status),
135 locateHandleBuffer: *const fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, num_handles: *usize, buffer: *[*]Handle) callconv(.C) Status,
136136
137137 /// Returns the first protocol instance that matches the given protocol.
138 locateProtocol: std.meta.FnPtr(fn (protocol: *align(8) const Guid, registration: ?*const anyopaque, interface: *?*anyopaque) callconv(.C) Status),
138 locateProtocol: *const fn (protocol: *align(8) const Guid, registration: ?*const anyopaque, interface: *?*anyopaque) callconv(.C) Status,
139139
140140 /// Installs one or more protocol interfaces into the boot services environment
141 installMultipleProtocolInterfaces: std.meta.FnPtr(fn (handle: *Handle, ...) callconv(.C) Status),
141 installMultipleProtocolInterfaces: *const fn (handle: *Handle, ...) callconv(.C) Status,
142142
143143 /// Removes one or more protocol interfaces into the boot services environment
144 uninstallMultipleProtocolInterfaces: std.meta.FnPtr(fn (handle: *Handle, ...) callconv(.C) Status),
144 uninstallMultipleProtocolInterfaces: *const fn (handle: *Handle, ...) callconv(.C) Status,
145145
146146 /// Computes and returns a 32-bit CRC for a data buffer.
147 calculateCrc32: std.meta.FnPtr(fn (data: [*]const u8, data_size: usize, *u32) callconv(.C) Status),
147 calculateCrc32: *const fn (data: [*]const u8, data_size: usize, *u32) callconv(.C) Status,
148148
149149 /// Copies the contents of one buffer to another buffer
150 copyMem: std.meta.FnPtr(fn (dest: [*]u8, src: [*]const u8, len: usize) callconv(.C) void),
150 copyMem: *const fn (dest: [*]u8, src: [*]const u8, len: usize) callconv(.C) void,
151151
152152 /// Fills a buffer with a specified value
153 setMem: std.meta.FnPtr(fn (buffer: [*]u8, size: usize, value: u8) callconv(.C) void),
153 setMem: *const fn (buffer: [*]u8, size: usize, value: u8) callconv(.C) void,
154154
155155 /// Creates an event in a group.
156 createEventEx: std.meta.FnPtr(fn (type: u32, notify_tpl: usize, notify_func: EfiEventNotify, notify_ctx: *const anyopaque, event_group: *align(8) const Guid, event: *Event) callconv(.C) Status),
156 createEventEx: *const fn (type: u32, notify_tpl: usize, notify_func: EfiEventNotify, notify_ctx: *const anyopaque, event_group: *align(8) const Guid, event: *Event) callconv(.C) Status,
157157
158158 /// Opens a protocol with a structure as the loaded image for a UEFI application
159159 pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol {
......@@ -191,7 +191,7 @@ pub const BootServices = extern struct {
191191 pub const tpl_high_level: usize = 31;
192192};
193193
194pub const EfiEventNotify = std.meta.FnPtr(fn (event: Event, ctx: *anyopaque) callconv(.C) void);
194pub const EfiEventNotify = *const fn (event: Event, ctx: *anyopaque) callconv(.C) void;
195195
196196pub const TimerDelay = enum(u32) {
197197 TimerCancel,
lib/std/os/uefi/tables/runtime_services.zig+14-14
......@@ -19,50 +19,50 @@ pub const RuntimeServices = extern struct {
1919 hdr: TableHeader,
2020
2121 /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
22 getTime: std.meta.FnPtr(fn (time: *uefi.Time, capabilities: ?*TimeCapabilities) callconv(.C) Status),
22 getTime: *const fn (time: *uefi.Time, capabilities: ?*TimeCapabilities) callconv(.C) Status,
2323
2424 /// Sets the current local time and date information
25 setTime: std.meta.FnPtr(fn (time: *uefi.Time) callconv(.C) Status),
25 setTime: *const fn (time: *uefi.Time) callconv(.C) Status,
2626
2727 /// Returns the current wakeup alarm clock setting
28 getWakeupTime: std.meta.FnPtr(fn (enabled: *bool, pending: *bool, time: *uefi.Time) callconv(.C) Status),
28 getWakeupTime: *const fn (enabled: *bool, pending: *bool, time: *uefi.Time) callconv(.C) Status,
2929
3030 /// Sets the system wakeup alarm clock time
31 setWakeupTime: std.meta.FnPtr(fn (enable: *bool, time: ?*uefi.Time) callconv(.C) Status),
31 setWakeupTime: *const fn (enable: *bool, time: ?*uefi.Time) callconv(.C) Status,
3232
3333 /// Changes the runtime addressing mode of EFI firmware from physical to virtual.
34 setVirtualAddressMap: std.meta.FnPtr(fn (mmap_size: usize, descriptor_size: usize, descriptor_version: u32, virtual_map: [*]MemoryDescriptor) callconv(.C) Status),
34 setVirtualAddressMap: *const fn (mmap_size: usize, descriptor_size: usize, descriptor_version: u32, virtual_map: [*]MemoryDescriptor) callconv(.C) Status,
3535
3636 /// Determines the new virtual address that is to be used on subsequent memory accesses.
37 convertPointer: std.meta.FnPtr(fn (debug_disposition: usize, address: **anyopaque) callconv(.C) Status),
37 convertPointer: *const fn (debug_disposition: usize, address: **anyopaque) callconv(.C) Status,
3838
3939 /// Returns the value of a variable.
40 getVariable: std.meta.FnPtr(fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: ?*u32, data_size: *usize, data: ?*anyopaque) callconv(.C) Status),
40 getVariable: *const fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: ?*u32, data_size: *usize, data: ?*anyopaque) callconv(.C) Status,
4141
4242 /// Enumerates the current variable names.
43 getNextVariableName: std.meta.FnPtr(fn (var_name_size: *usize, var_name: [*:0]u16, vendor_guid: *align(8) Guid) callconv(.C) Status),
43 getNextVariableName: *const fn (var_name_size: *usize, var_name: [*:0]u16, vendor_guid: *align(8) Guid) callconv(.C) Status,
4444
4545 /// Sets the value of a variable.
46 setVariable: std.meta.FnPtr(fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: u32, data_size: usize, data: *anyopaque) callconv(.C) Status),
46 setVariable: *const fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: u32, data_size: usize, data: *anyopaque) callconv(.C) Status,
4747
4848 /// Return the next high 32 bits of the platform's monotonic counter
49 getNextHighMonotonicCount: std.meta.FnPtr(fn (high_count: *u32) callconv(.C) Status),
49 getNextHighMonotonicCount: *const fn (high_count: *u32) callconv(.C) Status,
5050
5151 /// Resets the entire platform.
52 resetSystem: std.meta.FnPtr(fn (reset_type: ResetType, reset_status: Status, data_size: usize, reset_data: ?*const anyopaque) callconv(.C) noreturn),
52 resetSystem: *const fn (reset_type: ResetType, reset_status: Status, data_size: usize, reset_data: ?*const anyopaque) callconv(.C) noreturn,
5353
5454 /// Passes capsules to the firmware with both virtual and physical mapping.
5555 /// Depending on the intended consumption, the firmware may process the capsule immediately.
5656 /// If the payload should persist across a system reset, the reset value returned from
5757 /// `queryCapsuleCapabilities` must be passed into resetSystem and will cause the capsule
5858 /// to be processed by the firmware as part of the reset process.
59 updateCapsule: std.meta.FnPtr(fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, scatter_gather_list: EfiPhysicalAddress) callconv(.C) Status),
59 updateCapsule: *const fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, scatter_gather_list: EfiPhysicalAddress) callconv(.C) Status,
6060
6161 /// Returns if the capsule can be supported via `updateCapsule`
62 queryCapsuleCapabilities: std.meta.FnPtr(fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, maximum_capsule_size: *usize, resetType: ResetType) callconv(.C) Status),
62 queryCapsuleCapabilities: *const fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, maximum_capsule_size: *usize, resetType: ResetType) callconv(.C) Status,
6363
6464 /// Returns information about the EFI variables
65 queryVariableInfo: std.meta.FnPtr(fn (attributes: *u32, maximum_variable_storage_size: *u64, remaining_variable_storage_size: *u64, maximum_variable_size: *u64) callconv(.C) Status),
65 queryVariableInfo: *const fn (attributes: *u32, maximum_variable_storage_size: *u64, remaining_variable_storage_size: *u64, maximum_variable_size: *u64) callconv(.C) Status,
6666
6767 pub const signature: u64 = 0x56524553544e5552;
6868};
lib/std/os/windows.zig+12-12
......@@ -2696,7 +2696,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
26962696pub const MEM_DECOMMIT = 0x4000;
26972697pub const MEM_RELEASE = 0x8000;
26982698
2699pub const PTHREAD_START_ROUTINE = std.meta.FnPtr(fn (LPVOID) callconv(.C) DWORD);
2699pub const PTHREAD_START_ROUTINE = *const fn (LPVOID) callconv(.C) DWORD;
27002700pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
27012701
27022702pub const WIN32_FIND_DATAW = extern struct {
......@@ -2869,7 +2869,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {
28692869pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
28702870pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;
28712871
2872pub const PIMAGE_TLS_CALLBACK = ?std.meta.FnPtr(fn (PVOID, DWORD, PVOID) callconv(.C) void);
2872pub const PIMAGE_TLS_CALLBACK = ?*const fn (PVOID, DWORD, PVOID) callconv(.C) void;
28732873
28742874pub const PROV_RSA_FULL = 1;
28752875
......@@ -2922,14 +2922,14 @@ pub const RTL_QUERY_REGISTRY_TABLE = extern struct {
29222922 DefaultLength: ULONG,
29232923};
29242924
2925pub const RTL_QUERY_REGISTRY_ROUTINE = ?std.meta.FnPtr(fn (
2925pub const RTL_QUERY_REGISTRY_ROUTINE = ?*const fn (
29262926 PWSTR,
29272927 ULONG,
29282928 ?*anyopaque,
29292929 ULONG,
29302930 ?*anyopaque,
29312931 ?*anyopaque,
2932) callconv(WINAPI) NTSTATUS);
2932) callconv(WINAPI) NTSTATUS;
29332933
29342934/// Path is a full path
29352935pub const RTL_REGISTRY_ABSOLUTE = 0;
......@@ -3026,7 +3026,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;
30263026pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
30273027pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
30283028
3029pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?std.meta.FnPtr(fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void);
3029pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?*const fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void;
30303030
30313031pub const FILE_NOTIFY_CHANGE_CREATION = 64;
30323032pub const FILE_NOTIFY_CHANGE_SIZE = 8;
......@@ -3079,7 +3079,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {
30793079pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
30803080pub const INIT_ONCE = RTL_RUN_ONCE;
30813081pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;
3082pub const INIT_ONCE_FN = std.meta.FnPtr(fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL);
3082pub const INIT_ONCE_FN = *const fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL;
30833083
30843084pub const RTL_RUN_ONCE = extern struct {
30853085 Ptr: ?*anyopaque,
......@@ -3382,7 +3382,7 @@ pub const EXCEPTION_POINTERS = extern struct {
33823382 ContextRecord: *std.os.windows.CONTEXT,
33833383};
33843384
3385pub const VECTORED_EXCEPTION_HANDLER = std.meta.FnPtr(fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long);
3385pub const VECTORED_EXCEPTION_HANDLER = *const fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long;
33863386
33873387pub const OBJECT_ATTRIBUTES = extern struct {
33883388 Length: ULONG,
......@@ -3658,7 +3658,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
36583658 DosPath: UNICODE_STRING,
36593659};
36603660
3661pub const PPS_POST_PROCESS_INIT_ROUTINE = ?std.meta.FnPtr(fn () callconv(.C) void);
3661pub const PPS_POST_PROCESS_INIT_ROUTINE = ?*const fn () callconv(.C) void;
36623662
36633663pub const FILE_BOTH_DIR_INFORMATION = extern struct {
36643664 NextEntryOffset: ULONG,
......@@ -3678,7 +3678,7 @@ pub const FILE_BOTH_DIR_INFORMATION = extern struct {
36783678};
36793679pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION;
36803680
3681pub const IO_APC_ROUTINE = std.meta.FnPtr(fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void);
3681pub const IO_APC_ROUTINE = *const fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void;
36823682
36833683pub const CURDIR = extern struct {
36843684 DosPath: UNICODE_STRING,
......@@ -3750,8 +3750,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct {
37503750 PeakUsage: SIZE_T,
37513751};
37523752
3753pub const PENUM_PAGE_FILE_CALLBACKW = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL);
3754pub const PENUM_PAGE_FILE_CALLBACKA = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL);
3753pub const PENUM_PAGE_FILE_CALLBACKW = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL;
3754pub const PENUM_PAGE_FILE_CALLBACKA = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL;
37553755
37563756pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {
37573757 BasicInfo: PSAPI_WS_WATCH_INFORMATION,
......@@ -3851,7 +3851,7 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2;
38513851pub const CTRL_LOGOFF_EVENT: DWORD = 5;
38523852pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;
38533853
3854pub const HANDLER_ROUTINE = std.meta.FnPtr(fn (dwCtrlType: DWORD) callconv(WINAPI) BOOL);
3854pub const HANDLER_ROUTINE = *const fn (dwCtrlType: DWORD) callconv(WINAPI) BOOL;
38553855
38563856/// Processor feature enumeration.
38573857pub const PF = enum(DWORD) {
lib/std/os/windows/user32.zig+13-13
......@@ -39,7 +39,7 @@ fn selectSymbol(comptime function_static: anytype, function_dynamic: @TypeOf(fun
3939
4040// === Messages ===
4141
42pub const WNDPROC = std.meta.FnPtr(fn (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT);
42pub const WNDPROC = *const fn (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;
4343
4444pub const MSG = extern struct {
4545 hWnd: ?HWND,
......@@ -1056,7 +1056,7 @@ pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:
10561056}
10571057
10581058pub extern "user32" fn GetMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL;
1059pub var pfnGetMessageW: std.meta.FnPtr(@TypeOf(GetMessageW)) = undefined;
1059pub var pfnGetMessageW: *const @TypeOf(GetMessageW) = undefined;
10601060pub fn getMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void {
10611061 const function = selectSymbol(GetMessageW, pfnGetMessageW, .win2k);
10621062
......@@ -1087,7 +1087,7 @@ pub fn peekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:
10871087}
10881088
10891089pub extern "user32" fn PeekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) callconv(WINAPI) BOOL;
1090pub var pfnPeekMessageW: std.meta.FnPtr(@TypeOf(PeekMessageW)) = undefined;
1090pub var pfnPeekMessageW: *const @TypeOf(PeekMessageW) = undefined;
10911091pub fn peekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool {
10921092 const function = selectSymbol(PeekMessageW, pfnPeekMessageW, .win2k);
10931093
......@@ -1112,7 +1112,7 @@ pub fn dispatchMessageA(lpMsg: *const MSG) LRESULT {
11121112}
11131113
11141114pub extern "user32" fn DispatchMessageW(lpMsg: *const MSG) callconv(WINAPI) LRESULT;
1115pub var pfnDispatchMessageW: std.meta.FnPtr(@TypeOf(DispatchMessageW)) = undefined;
1115pub var pfnDispatchMessageW: *const @TypeOf(DispatchMessageW) = undefined;
11161116pub fn dispatchMessageW(lpMsg: *const MSG) LRESULT {
11171117 const function = selectSymbol(DispatchMessageW, pfnDispatchMessageW, .win2k);
11181118 return function(lpMsg);
......@@ -1129,7 +1129,7 @@ pub fn defWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRE
11291129}
11301130
11311131pub extern "user32" fn DefWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;
1132pub var pfnDefWindowProcW: std.meta.FnPtr(@TypeOf(DefWindowProcW)) = undefined;
1132pub var pfnDefWindowProcW: *const @TypeOf(DefWindowProcW) = undefined;
11331133pub fn defWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT {
11341134 const function = selectSymbol(DefWindowProcW, pfnDefWindowProcW, .win2k);
11351135 return function(hWnd, Msg, wParam, lParam);
......@@ -1191,7 +1191,7 @@ pub fn registerClassExA(window_class: *const WNDCLASSEXA) !ATOM {
11911191}
11921192
11931193pub extern "user32" fn RegisterClassExW(*const WNDCLASSEXW) callconv(WINAPI) ATOM;
1194pub var pfnRegisterClassExW: std.meta.FnPtr(@TypeOf(RegisterClassExW)) = undefined;
1194pub var pfnRegisterClassExW: *const @TypeOf(RegisterClassExW) = undefined;
11951195pub fn registerClassExW(window_class: *const WNDCLASSEXW) !ATOM {
11961196 const function = selectSymbol(RegisterClassExW, pfnRegisterClassExW, .win2k);
11971197 const atom = function(window_class);
......@@ -1215,7 +1215,7 @@ pub fn unregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) !void
12151215}
12161216
12171217pub extern "user32" fn UnregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) callconv(WINAPI) BOOL;
1218pub var pfnUnregisterClassW: std.meta.FnPtr(@TypeOf(UnregisterClassW)) = undefined;
1218pub var pfnUnregisterClassW: *const @TypeOf(UnregisterClassW) = undefined;
12191219pub fn unregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) !void {
12201220 const function = selectSymbol(UnregisterClassW, pfnUnregisterClassW, .win2k);
12211221 if (function(lpClassName, hInstance) == 0) {
......@@ -1292,7 +1292,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName:
12921292}
12931293
12941294pub extern "user32" fn CreateWindowExW(dwExStyle: DWORD, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND;
1295pub var pfnCreateWindowExW: std.meta.FnPtr(@TypeOf(CreateWindowExW)) = undefined;
1295pub var pfnCreateWindowExW: *const @TypeOf(CreateWindowExW) = undefined;
12961296pub fn createWindowExW(dwExStyle: u32, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND {
12971297 const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k);
12981298 const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam);
......@@ -1382,7 +1382,7 @@ pub fn getWindowLongA(hWnd: HWND, nIndex: i32) !i32 {
13821382}
13831383
13841384pub extern "user32" fn GetWindowLongW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG;
1385pub var pfnGetWindowLongW: std.meta.FnPtr(@TypeOf(GetWindowLongW)) = undefined;
1385pub var pfnGetWindowLongW: *const @TypeOf(GetWindowLongW) = undefined;
13861386pub fn getWindowLongW(hWnd: HWND, nIndex: i32) !i32 {
13871387 const function = selectSymbol(GetWindowLongW, pfnGetWindowLongW, .win2k);
13881388
......@@ -1415,7 +1415,7 @@ pub fn getWindowLongPtrA(hWnd: HWND, nIndex: i32) !isize {
14151415}
14161416
14171417pub extern "user32" fn GetWindowLongPtrW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG_PTR;
1418pub var pfnGetWindowLongPtrW: std.meta.FnPtr(@TypeOf(GetWindowLongPtrW)) = undefined;
1418pub var pfnGetWindowLongPtrW: *const @TypeOf(GetWindowLongPtrW) = undefined;
14191419pub fn getWindowLongPtrW(hWnd: HWND, nIndex: i32) !isize {
14201420 if (@sizeOf(LONG_PTR) == 4) return getWindowLongW(hWnd, nIndex);
14211421 const function = selectSymbol(GetWindowLongPtrW, pfnGetWindowLongPtrW, .win2k);
......@@ -1449,7 +1449,7 @@ pub fn setWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
14491449}
14501450
14511451pub extern "user32" fn SetWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: LONG) callconv(WINAPI) LONG;
1452pub var pfnSetWindowLongW: std.meta.FnPtr(@TypeOf(SetWindowLongW)) = undefined;
1452pub var pfnSetWindowLongW: *const @TypeOf(SetWindowLongW) = undefined;
14531453pub fn setWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
14541454 const function = selectSymbol(SetWindowLongW, pfnSetWindowLongW, .win2k);
14551455
......@@ -1484,7 +1484,7 @@ pub fn setWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
14841484}
14851485
14861486pub extern "user32" fn SetWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: LONG_PTR) callconv(WINAPI) LONG_PTR;
1487pub var pfnSetWindowLongPtrW: std.meta.FnPtr(@TypeOf(SetWindowLongPtrW)) = undefined;
1487pub var pfnSetWindowLongPtrW: *const @TypeOf(SetWindowLongPtrW) = undefined;
14881488pub fn setWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
14891489 if (@sizeOf(LONG_PTR) == 4) return setWindowLongW(hWnd, nIndex, dwNewLong);
14901490 const function = selectSymbol(SetWindowLongPtrW, pfnSetWindowLongPtrW, .win2k);
......@@ -1580,7 +1580,7 @@ pub fn messageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8,
15801580}
15811581
15821582pub extern "user32" fn MessageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: ?[*:0]const u16, uType: UINT) callconv(WINAPI) i32;
1583pub var pfnMessageBoxW: std.meta.FnPtr(@TypeOf(MessageBoxW)) = undefined;
1583pub var pfnMessageBoxW: *const @TypeOf(MessageBoxW) = undefined;
15841584pub fn messageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: [*:0]const u16, uType: u32) !i32 {
15851585 const function = selectSymbol(MessageBoxW, pfnMessageBoxW, .win2k);
15861586 const value = function(hWnd, lpText, lpCaption, uType);
lib/std/os/windows/ws2_32.zig+18-18
......@@ -942,7 +942,7 @@ pub const UDP_NOCHECKSUM = 1;
942942pub const UDP_CHECKSUM_COVERAGE = 20;
943943pub const GAI_STRERROR_BUFFER_SIZE = 1024;
944944
945pub const LPCONDITIONPROC = std.meta.FnPtr(fn (
945pub const LPCONDITIONPROC = *const fn (
946946 lpCallerId: *WSABUF,
947947 lpCallerData: *WSABUF,
948948 lpSQOS: *QOS,
......@@ -951,14 +951,14 @@ pub const LPCONDITIONPROC = std.meta.FnPtr(fn (
951951 lpCalleeData: *WSABUF,
952952 g: *u32,
953953 dwCallbackData: usize,
954) callconv(WINAPI) i32);
954) callconv(WINAPI) i32;
955955
956pub const LPWSAOVERLAPPED_COMPLETION_ROUTINE = std.meta.FnPtr(fn (
956pub const LPWSAOVERLAPPED_COMPLETION_ROUTINE = *const fn (
957957 dwError: u32,
958958 cbTransferred: u32,
959959 lpOverlapped: *OVERLAPPED,
960960 dwFlags: u32,
961) callconv(WINAPI) void);
961) callconv(WINAPI) void;
962962
963963pub const FLOWSPEC = extern struct {
964964 TokenRate: u32,
......@@ -1173,7 +1173,7 @@ pub const TRANSMIT_FILE_BUFFERS = extern struct {
11731173 TailLength: u32,
11741174};
11751175
1176pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn (
1176pub const LPFN_TRANSMITFILE = *const fn (
11771177 hSocket: SOCKET,
11781178 hFile: HANDLE,
11791179 nNumberOfBytesToWrite: u32,
......@@ -1181,9 +1181,9 @@ pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn (
11811181 lpOverlapped: ?*OVERLAPPED,
11821182 lpTransmitBuffers: ?*TRANSMIT_FILE_BUFFERS,
11831183 dwReserved: u32,
1184) callconv(WINAPI) BOOL);
1184) callconv(WINAPI) BOOL;
11851185
1186pub const LPFN_ACCEPTEX = std.meta.FnPtr(fn (
1186pub const LPFN_ACCEPTEX = *const fn (
11871187 sListenSocket: SOCKET,
11881188 sAcceptSocket: SOCKET,
11891189 lpOutputBuffer: *anyopaque,
......@@ -1192,9 +1192,9 @@ pub const LPFN_ACCEPTEX = std.meta.FnPtr(fn (
11921192 dwRemoteAddressLength: u32,
11931193 lpdwBytesReceived: *u32,
11941194 lpOverlapped: *OVERLAPPED,
1195) callconv(WINAPI) BOOL);
1195) callconv(WINAPI) BOOL;
11961196
1197pub const LPFN_GETACCEPTEXSOCKADDRS = std.meta.FnPtr(fn (
1197pub const LPFN_GETACCEPTEXSOCKADDRS = *const fn (
11981198 lpOutputBuffer: *anyopaque,
11991199 dwReceiveDataLength: u32,
12001200 dwLocalAddressLength: u32,
......@@ -1203,29 +1203,29 @@ pub const LPFN_GETACCEPTEXSOCKADDRS = std.meta.FnPtr(fn (
12031203 LocalSockaddrLength: *i32,
12041204 RemoteSockaddr: **sockaddr,
12051205 RemoteSockaddrLength: *i32,
1206) callconv(WINAPI) void);
1206) callconv(WINAPI) void;
12071207
1208pub const LPFN_WSASENDMSG = std.meta.FnPtr(fn (
1208pub const LPFN_WSASENDMSG = *const fn (
12091209 s: SOCKET,
12101210 lpMsg: *const std.x.os.Socket.Message,
12111211 dwFlags: u32,
12121212 lpNumberOfBytesSent: ?*u32,
12131213 lpOverlapped: ?*OVERLAPPED,
12141214 lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE,
1215) callconv(WINAPI) i32);
1215) callconv(WINAPI) i32;
12161216
1217pub const LPFN_WSARECVMSG = std.meta.FnPtr(fn (
1217pub const LPFN_WSARECVMSG = *const fn (
12181218 s: SOCKET,
12191219 lpMsg: *std.x.os.Socket.Message,
12201220 lpdwNumberOfBytesRecv: ?*u32,
12211221 lpOverlapped: ?*OVERLAPPED,
12221222 lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE,
1223) callconv(WINAPI) i32);
1223) callconv(WINAPI) i32;
12241224
1225pub const LPSERVICE_CALLBACK_PROC = std.meta.FnPtr(fn (
1225pub const LPSERVICE_CALLBACK_PROC = *const fn (
12261226 lParam: LPARAM,
12271227 hAsyncTaskHandle: HANDLE,
1228) callconv(WINAPI) void);
1228) callconv(WINAPI) void;
12291229
12301230pub const SERVICE_ASYNC_INFO = extern struct {
12311231 lpServiceCallbackProc: LPSERVICE_CALLBACK_PROC,
......@@ -1233,11 +1233,11 @@ pub const SERVICE_ASYNC_INFO = extern struct {
12331233 hAsyncTaskHandle: HANDLE,
12341234};
12351235
1236pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = std.meta.FnPtr(fn (
1236pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = *const fn (
12371237 dwError: u32,
12381238 dwBytes: u32,
12391239 lpOverlapped: *OVERLAPPED,
1240) callconv(WINAPI) void);
1240) callconv(WINAPI) void;
12411241
12421242pub const fd_set = extern struct {
12431243 fd_count: u32,
lib/std/packed_int_array.zig+9-5
......@@ -338,12 +338,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type {
338338 };
339339}
340340
341const we_are_testing_this_with_stage1_which_leaks_comptime_memory = true;
342
343341test "PackedIntArray" {
344342 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
345343 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
346 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
344
345 // TODO: enable this test
346 if (true) return error.SkipZigTest;
347347
348348 @setEvalBranchQuota(10000);
349349 const max_bits = 256;
......@@ -405,7 +405,9 @@ test "PackedIntArray initAllTo" {
405405test "PackedIntSlice" {
406406 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
407407 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
408 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
408
409 // TODO enable this test
410 if (true) return error.SkipZigTest;
409411
410412 @setEvalBranchQuota(10000);
411413 const max_bits = 256;
......@@ -444,7 +446,9 @@ test "PackedIntSlice" {
444446}
445447
446448test "PackedIntSlice of PackedInt(Array/Slice)" {
447 if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest;
449 // TODO enable this test
450 if (true) return error.SkipZigTest;
451
448452 const max_bits = 16;
449453 const int_count = 19;
450454
lib/std/rand.zig+1-1
......@@ -30,7 +30,7 @@ pub const RomuTrio = @import("rand/RomuTrio.zig");
3030
3131pub const Random = struct {
3232 ptr: *anyopaque,
33 fillFn: std.meta.FnPtr(fn (ptr: *anyopaque, buf: []u8) void),
33 fillFn: *const fn (ptr: *anyopaque, buf: []u8) void,
3434
3535 pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random {
3636 const Ptr = @TypeOf(pointer);
lib/std/segmented_list.zig+1-1
......@@ -412,7 +412,7 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
412412}
413413
414414test "SegmentedList basic usage" {
415 if (@import("builtin").zig_backend == .stage1) {
415 if (false) {
416416 // https://github.com/ziglang/zig/issues/11787
417417 try testSegmentedList(0);
418418 }
lib/std/simd.zig+2-4
......@@ -191,9 +191,7 @@ pub fn extract(
191191}
192192
193193test "vector patterns" {
194 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
195 builtin.cpu.arch == .aarch64)
196 {
194 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
197195 // https://github.com/ziglang/zig/issues/12012
198196 return error.SkipZigTest;
199197 }
......@@ -419,7 +417,7 @@ test "vector prefix scan" {
419417 return error.SkipZigTest;
420418 }
421419
422 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {
420 if (builtin.zig_backend == .stage2_llvm) {
423421 // Regressed in LLVM 14:
424422 // https://github.com/llvm/llvm-project/issues/55522
425423 return error.SkipZigTest;
lib/std/unicode.zig+1-3
......@@ -354,9 +354,7 @@ fn testUtf16CountCodepoints() !void {
354354
355355test "utf16 count codepoints" {
356356 try testUtf16CountCodepoints();
357 // TODO stage1 error: out of bounds slice
358 if (@import("builtin").zig_backend != .stage1)
359 comptime try testUtf16CountCodepoints();
357 comptime try testUtf16CountCodepoints();
360358}
361359
362360test "utf8 encode" {
lib/std/zig/Ast.zig-2
......@@ -2009,8 +2009,6 @@ fn fullStructInit(tree: Ast, info: full.StructInit.Components) full.StructInit {
20092009
20102010fn fullPtrType(tree: Ast, info: full.PtrType.Components) full.PtrType {
20112011 const token_tags = tree.tokens.items(.tag);
2012 // TODO: looks like stage1 isn't quite smart enough to handle enum
2013 // literals in some places here
20142012 const Size = std.builtin.Type.Pointer.Size;
20152013 const size: Size = switch (token_tags[info.main_token]) {
20162014 .asterisk,
lib/std/zig/c_translation.zig+4-18
......@@ -9,19 +9,13 @@ pub fn cast(comptime DestType: type, target: anytype) DestType {
99 // this function should behave like transCCast in translate-c, except it's for macros
1010 const SourceType = @TypeOf(target);
1111 switch (@typeInfo(DestType)) {
12 .Fn => if (builtin.zig_backend == .stage1)
13 return castToPtr(DestType, SourceType, target)
14 else
15 return castToPtr(*const DestType, SourceType, target),
12 .Fn => return castToPtr(*const DestType, SourceType, target),
1613 .Pointer => return castToPtr(DestType, SourceType, target),
1714 .Optional => |dest_opt| {
1815 if (@typeInfo(dest_opt.child) == .Pointer) {
1916 return castToPtr(DestType, SourceType, target);
2017 } else if (@typeInfo(dest_opt.child) == .Fn) {
21 if (builtin.zig_backend == .stage1)
22 return castToPtr(DestType, SourceType, target)
23 else
24 return castToPtr(?*const dest_opt.child, SourceType, target);
18 return castToPtr(?*const dest_opt.child, SourceType, target);
2519 }
2620 },
2721 .Int => {
......@@ -149,7 +143,7 @@ test "cast" {
149143 try testing.expect(cast(?*anyopaque, -1) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))));
150144 try testing.expect(cast(?*anyopaque, foo) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))));
151145
152 const FnPtr = ?if (builtin.zig_backend == .stage1) fn (*anyopaque) void else *align(1) const fn (*anyopaque) void;
146 const FnPtr = ?*align(1) const fn (*anyopaque) void;
153147 try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0)));
154148 try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1))));
155149}
......@@ -160,12 +154,6 @@ pub fn sizeof(target: anytype) usize {
160154 switch (@typeInfo(T)) {
161155 .Float, .Int, .Struct, .Union, .Array, .Bool, .Vector => return @sizeOf(T),
162156 .Fn => {
163 if (builtin.zig_backend == .stage1) {
164 // sizeof(main) returns 1, sizeof(&main) returns pointer size.
165 // We cannot distinguish those types in Zig, so use pointer size.
166 return @sizeOf(T);
167 }
168
169157 // sizeof(main) in C returns 1
170158 return 1;
171159 },
......@@ -263,9 +251,7 @@ test "sizeof" {
263251 try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size);
264252 try testing.expect(sizeof(*const [4]u8) == ptr_size);
265253
266 if (builtin.zig_backend == .stage1) {
267 try testing.expect(sizeof(sizeof) == @sizeOf(@TypeOf(sizeof)));
268 } else if (false) { // TODO
254 if (false) { // TODO
269255 try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof)));
270256 try testing.expect(sizeof(sizeof) == 1);
271257 }
lib/std/zig/render.zig+1-1
......@@ -2211,7 +2211,7 @@ fn renderAsm(
22112211 },
22122212 else => unreachable,
22132213 }
2214 } else unreachable; // TODO shouldn't need this on while(true)
2214 }
22152215}
22162216
22172217fn renderCall(
lib/std/zig/string_literal.zig+1-1
......@@ -266,7 +266,7 @@ pub fn parseWrite(writer: anytype, bytes: []const u8) error{OutOfMemory}!Result
266266 index += 1;
267267 },
268268 }
269 } else unreachable; // TODO should not need else unreachable on while(true)
269 }
270270}
271271
272272/// Higher level API. Does not return extra info about parse errors.
src/Compilation.zig+11-12
......@@ -5431,11 +5431,6 @@ pub fn build_crt_file(
54315431 });
54325432 errdefer comp.gpa.free(basename);
54335433
5434 // TODO: This is extracted into a local variable to work around a stage1 miscompilation.
5435 const emit_bin = Compilation.EmitLoc{
5436 .directory = null, // Put it in the cache directory.
5437 .basename = basename,
5438 };
54395434 const sub_compilation = try Compilation.create(comp.gpa, .{
54405435 .local_cache_directory = comp.global_cache_directory,
54415436 .global_cache_directory = comp.global_cache_directory,
......@@ -5447,7 +5442,10 @@ pub fn build_crt_file(
54475442 .output_mode = output_mode,
54485443 .thread_pool = comp.thread_pool,
54495444 .libc_installation = comp.bin_file.options.libc_installation,
5450 .emit_bin = emit_bin,
5445 .emit_bin = .{
5446 .directory = null, // Put it in the cache directory.
5447 .basename = basename,
5448 },
54515449 .optimize_mode = comp.compilerRtOptMode(),
54525450 .want_sanitize_c = false,
54535451 .want_stack_check = false,
......@@ -5492,15 +5490,16 @@ pub fn build_crt_file(
54925490 });
54935491}
54945492
5495pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void {
5493pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void {
54965494 // Avoid deadlocking on building import libs such as kernel32.lib
5497 // This can happen when the user uses `build-exe foo.obj -lkernel32` and then
5498 // when we create a sub-Compilation for zig libc, it also tries to build kernel32.lib.
5495 // This can happen when the user uses `build-exe foo.obj -lkernel32` and
5496 // then when we create a sub-Compilation for zig libc, it also tries to
5497 // build kernel32.lib.
54995498 if (comp.bin_file.options.skip_linker_dependencies) return;
55005499
5501 // This happens when an `extern "foo"` function is referenced by the stage1 backend.
5502 // If we haven't seen this library yet and we're targeting Windows, we need to queue up
5503 // a work item to produce the DLL import library for this.
5500 // This happens when an `extern "foo"` function is referenced.
5501 // If we haven't seen this library yet and we're targeting Windows, we need
5502 // to queue up a work item to produce the DLL import library for this.
55045503 const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name);
55055504 if (!gop.found_existing and comp.getTarget().os.tag == .windows) {
55065505 try comp.work_queue.writeItem(.{
src/Module.zig+6-8
......@@ -71,7 +71,7 @@ import_table: std.StringArrayHashMapUnmanaged(*File) = .{},
7171/// Keys are fully resolved file paths. This table owns the keys and values.
7272embed_table: std.StringHashMapUnmanaged(*EmbedFile) = .{},
7373
74/// This is a temporary addition to stage2 in order to match stage1 behavior,
74/// This is a temporary addition to stage2 in order to match legacy behavior,
7575/// however the end-game once the lang spec is settled will be to use a global
7676/// InternPool for comptime memoized objects, making this behavior consistent across all types,
7777/// not only string literals. Or, we might decide to not guarantee string literals
......@@ -3544,17 +3544,15 @@ fn freeExportList(gpa: Allocator, export_list: *ArrayListUnmanaged(*Export)) voi
35443544 export_list.deinit(gpa);
35453545}
35463546
3547// TODO https://github.com/ziglang/zig/issues/8643
35473548const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8;
3548// TODO This is taking advantage of matching stage1 debug union layout.
3549// We need a better language feature for initializing a union with
3550// a runtime-known tag.
3551const Stage1DataLayout = extern struct {
3549const HackDataLayout = extern struct {
35523550 data: [8]u8 align(@alignOf(Zir.Inst.Data)),
35533551 safety_tag: u8,
35543552};
35553553comptime {
35563554 if (data_has_safety_tag) {
3557 assert(@sizeOf(Stage1DataLayout) == @sizeOf(Zir.Inst.Data));
3555 assert(@sizeOf(HackDataLayout) == @sizeOf(Zir.Inst.Data));
35583556 }
35593557}
35603558
......@@ -3695,7 +3693,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {
36953693 const tags = zir.instructions.items(.tag);
36963694 for (zir.instructions.items(.data)) |*data, i| {
36973695 const union_tag = Zir.Inst.Tag.data_tags[@enumToInt(tags[i])];
3698 const as_struct = @ptrCast(*Stage1DataLayout, data);
3696 const as_struct = @ptrCast(*HackDataLayout, data);
36993697 as_struct.* = .{
37003698 .safety_tag = @enumToInt(union_tag),
37013699 .data = safety_buffer[i],
......@@ -3881,7 +3879,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {
38813879 if (data_has_safety_tag) {
38823880 // The `Data` union has a safety tag but in the file format we store it without.
38833881 for (file.zir.instructions.items(.data)) |*data, i| {
3884 const as_struct = @ptrCast(*const Stage1DataLayout, data);
3882 const as_struct = @ptrCast(*const HackDataLayout, data);
38853883 safety_buffer[i] = as_struct.data;
38863884 }
38873885 }
src/Sema.zig+18-24
......@@ -1359,7 +1359,7 @@ fn analyzeBodyInner(
13591359 break check_block.runtime_index;
13601360 }
13611361 check_block = check_block.parent.?;
1362 } else unreachable;
1362 };
13631363
13641364 if (@enumToInt(target_runtime_index) < @enumToInt(block.runtime_index)) {
13651365 const runtime_src = block.runtime_cond orelse block.runtime_loop.?;
......@@ -1733,7 +1733,7 @@ fn analyzeBodyInner(
17331733 break always_noreturn;
17341734 map.putAssumeCapacity(inst, air_inst);
17351735 i += 1;
1736 } else unreachable;
1736 };
17371737
17381738 // balance out dbg_block_begins in case of early noreturn
17391739 const noreturn_inst = block.instructions.popOrNull();
......@@ -3478,7 +3478,7 @@ fn zirMakePtrConst(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
34783478 .store => break candidate,
34793479 else => break :ct,
34803480 }
3481 } else unreachable; // TODO shouldn't need this
3481 };
34823482
34833483 while (true) {
34843484 if (search_index == 0) break :ct;
......@@ -3704,7 +3704,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
37043704 .store => break candidate,
37053705 else => break :ct,
37063706 }
3707 } else unreachable; // TODO shouldn't need this
3707 };
37083708
37093709 const bitcast_inst = while (true) {
37103710 if (search_index == 0) break :ct;
......@@ -3716,7 +3716,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
37163716 .bitcast => break candidate,
37173717 else => break :ct,
37183718 }
3719 } else unreachable; // TODO shouldn't need this
3719 };
37203720
37213721 const const_inst = while (true) {
37223722 if (search_index == 0) break :ct;
......@@ -3728,7 +3728,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
37283728 .constant => break candidate,
37293729 else => break :ct,
37303730 }
3731 } else unreachable; // TODO shouldn't need this
3731 };
37323732
37333733 const store_op = air_datas[store_inst].bin_op;
37343734 const store_val = (try sema.resolveMaybeUndefVal(store_op.rhs)) orelse break :ct;
......@@ -8307,7 +8307,7 @@ fn handleExternLibName(
83078307 .{ lib_name, lib_name },
83088308 );
83098309 }
8310 comp.stage1AddLinkLib(lib_name) catch |err| {
8310 comp.addLinkLib(lib_name) catch |err| {
83118311 return sema.fail(block, src_loc, "unable to add link lib '{s}': {s}", .{
83128312 lib_name, @errorName(err),
83138313 });
......@@ -8401,15 +8401,11 @@ fn funcCommon(
84018401 }
84028402 }
84038403
8404 // These locals are pulled out from the init expression below to work around
8405 // a stage1 compiler bug.
84068404 // In the case of generic calling convention, or generic alignment, we use
84078405 // default values which are only meaningful for the generic function, *not*
84088406 // the instantiation, which can depend on comptime parameters.
84098407 // Related proposal: https://github.com/ziglang/zig/issues/11834
8410 const cc_workaround = cc orelse .Unspecified;
8411 const align_workaround = alignment orelse 0;
8412
8408 const cc_resolved = cc orelse .Unspecified;
84138409 const param_types = try sema.arena.alloc(Type, block.params.items.len);
84148410 const comptime_params = try sema.arena.alloc(bool, block.params.items.len);
84158411 for (block.params.items) |param, i| {
......@@ -8421,7 +8417,7 @@ fn funcCommon(
84218417 comptime_params,
84228418 i,
84238419 &is_generic,
8424 cc_workaround,
8420 cc_resolved,
84258421 has_body,
84268422 ) catch |err| switch (err) {
84278423 error.NeededSourceLocation => {
......@@ -8433,7 +8429,7 @@ fn funcCommon(
84338429 comptime_params,
84348430 i,
84358431 &is_generic,
8436 cc_workaround,
8432 cc_resolved,
84378433 has_body,
84388434 );
84398435 return error.AnalysisFail;
......@@ -8481,10 +8477,10 @@ fn funcCommon(
84818477 };
84828478 return sema.failWithOwnedErrorMsg(msg);
84838479 }
8484 if (!Type.fnCallingConventionAllowsZigTypes(cc_workaround) and !try sema.validateExternType(return_type, .ret_ty)) {
8480 if (!Type.fnCallingConventionAllowsZigTypes(cc_resolved) and !try sema.validateExternType(return_type, .ret_ty)) {
84858481 const msg = msg: {
84868482 const msg = try sema.errMsg(block, ret_ty_src, "return type '{}' not allowed in function with calling convention '{s}'", .{
8487 return_type.fmt(sema.mod), @tagName(cc_workaround),
8483 return_type.fmt(sema.mod), @tagName(cc_resolved),
84888484 });
84898485 errdefer msg.destroy(sema.gpa);
84908486
......@@ -8533,7 +8529,7 @@ fn funcCommon(
85338529 }
85348530
85358531 const arch = sema.mod.getTarget().cpu.arch;
8536 if (switch (cc_workaround) {
8532 if (switch (cc_resolved) {
85378533 .Unspecified, .C, .Naked, .Async, .Inline => null,
85388534 .Interrupt => switch (arch) {
85398535 .x86, .x86_64, .avr, .msp430 => null,
......@@ -8569,13 +8565,13 @@ fn funcCommon(
85698565 },
85708566 }) |allowed_platform| {
85718567 return sema.fail(block, cc_src, "callconv '{s}' is only available on {s}, not {s}", .{
8572 @tagName(cc_workaround),
8568 @tagName(cc_resolved),
85738569 allowed_platform,
85748570 @tagName(arch),
85758571 });
85768572 }
85778573
8578 if (cc_workaround == .Inline and is_noinline) {
8574 if (cc_resolved == .Inline and is_noinline) {
85798575 return sema.fail(block, cc_src, "'noinline' function cannot have callconv 'Inline'", .{});
85808576 }
85818577 if (is_generic and sema.no_partial_func_ty) return error.GenericPoison;
......@@ -8593,9 +8589,9 @@ fn funcCommon(
85938589 .param_types = param_types,
85948590 .comptime_params = comptime_params.ptr,
85958591 .return_type = return_type,
8596 .cc = cc_workaround,
8592 .cc = cc_resolved,
85978593 .cc_is_generic = cc == null,
8598 .alignment = align_workaround,
8594 .alignment = alignment orelse 0,
85998595 .align_is_generic = alignment == null,
86008596 .section_is_generic = section == .generic,
86018597 .addrspace_is_generic = address_space == null,
......@@ -14964,7 +14960,7 @@ fn zirClosureGet(
1496414960 break tv;
1496514961 }
1496614962 scope = scope.parent.?;
14967 } else unreachable;
14963 };
1496814964
1496914965 if (tv.val.tag() == .unreachable_value and !block.is_typeof and sema.func == null) {
1497014966 const msg = msg: {
......@@ -19107,8 +19103,6 @@ fn zirPtrCast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1910719103 const operand_elem_size = operand_elem_ty.abiSize(target);
1910819104 const dest_elem_size = dest_elem_ty.abiSize(target);
1910919105 if (operand_elem_size != dest_elem_size) {
19110 // note that this is not implemented in stage1 so we should probably wait
19111 // until that codebase is replaced before implementing this in stage2.
1911219106 return sema.fail(block, dest_ty_src, "TODO: implement @ptrCast between slices changing the length", .{});
1911319107 }
1911419108 }
src/ThreadPool.zig+1-4
......@@ -15,10 +15,7 @@ const Runnable = struct {
1515 runFn: RunProto,
1616};
1717
18const RunProto = switch (builtin.zig_backend) {
19 .stage1 => fn (*Runnable) void,
20 else => *const fn (*Runnable) void,
21};
18const RunProto = *const fn (*Runnable) void;
2219
2320pub fn init(pool: *ThreadPool, allocator: std.mem.Allocator) !void {
2421 pool.* = .{
src/clang.zig+5-6
......@@ -161,12 +161,11 @@ pub const ASTUnit = opaque {
161161 extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager;
162162
163163 pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls;
164 extern fn ZigClangASTUnit_visitLocalTopLevelDecls(*ASTUnit, context: ?*anyopaque, Fn: ?VisitorFn) bool;
165
166 const VisitorFn = if (@import("builtin").zig_backend == .stage1)
167 fn (?*anyopaque, *const Decl) callconv(.C) bool
168 else
169 *const fn (?*anyopaque, *const Decl) callconv(.C) bool;
164 extern fn ZigClangASTUnit_visitLocalTopLevelDecls(
165 *ASTUnit,
166 context: ?*anyopaque,
167 Fn: ?*const fn (?*anyopaque, *const Decl) callconv(.C) bool,
168 ) bool;
170169
171170 pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin;
172171 extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator;
src/codegen.zig+1-42
......@@ -98,54 +98,13 @@ pub fn generateFunction(
9898 .aarch64_be,
9999 .aarch64_32,
100100 => return @import("arch/aarch64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
101 //.arc => return Function(.arc).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
102 //.avr => return Function(.avr).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
103 //.bpfel => return Function(.bpfel).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
104 //.bpfeb => return Function(.bpfeb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
105 //.hexagon => return Function(.hexagon).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
106 //.mips => return Function(.mips).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
107 //.mipsel => return Function(.mipsel).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
108 //.mips64 => return Function(.mips64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
109 //.mips64el => return Function(.mips64el).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
110 //.msp430 => return Function(.msp430).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
111 //.powerpc => return Function(.powerpc).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
112 //.powerpc64 => return Function(.powerpc64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
113 //.powerpc64le => return Function(.powerpc64le).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
114 //.r600 => return Function(.r600).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
115 //.amdgcn => return Function(.amdgcn).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
116 //.riscv32 => return Function(.riscv32).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
117101 .riscv64 => return @import("arch/riscv64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
118 //.sparc => return Function(.sparc).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
119102 .sparc64 => return @import("arch/sparc64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
120 //.sparcel => return Function(.sparcel).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
121 //.s390x => return Function(.s390x).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
122 //.tce => return Function(.tce).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
123 //.tcele => return Function(.tcele).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
124 //.thumb => return Function(.thumb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
125 //.thumbeb => return Function(.thumbeb).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
126 //.x86 => return Function(.x86).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
127103 .x86_64 => return @import("arch/x86_64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
128 //.xcore => return Function(.xcore).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
129 //.nvptx => return Function(.nvptx).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
130 //.nvptx64 => return Function(.nvptx64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
131 //.le32 => return Function(.le32).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
132 //.le64 => return Function(.le64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
133 //.amdil => return Function(.amdil).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
134 //.amdil64 => return Function(.amdil64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
135 //.hsail => return Function(.hsail).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
136 //.hsail64 => return Function(.hsail64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
137 //.spir => return Function(.spir).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
138 //.spir64 => return Function(.spir64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
139 //.kalimba => return Function(.kalimba).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
140 //.shave => return Function(.shave).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
141 //.lanai => return Function(.lanai).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
142 //.renderscript32 => return Function(.renderscript32).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
143 //.renderscript64 => return Function(.renderscript64).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
144 //.ve => return Function(.ve).generate(bin_file, src_loc, func, air, liveness, code, debug_output),
145104 .wasm32,
146105 .wasm64,
147106 => return @import("arch/wasm/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),
148 else => @panic("Backend architectures that don't have good support yet are commented out, to improve compilation performance. If you are interested in one of these other backends feel free to uncomment them. Eventually these will be completed, but stage1 is slow and a memory hog."),
107 else => unreachable,
149108 }
150109}
151110
src/codegen/c.zig+2-4
......@@ -4972,8 +4972,7 @@ fn airStructFieldPtr(f: *Function, inst: Air.Inst.Index) !CValue {
49724972
49734973 if (f.liveness.isUnused(inst)) {
49744974 try reap(f, inst, &.{extra.struct_operand});
4975 // TODO this @as is needed because of a stage1 bug
4976 return @as(CValue, CValue.none);
4975 return .none;
49774976 }
49784977
49794978 const struct_ptr = try f.resolveInst(extra.struct_operand);
......@@ -4987,8 +4986,7 @@ fn airStructFieldPtrIndex(f: *Function, inst: Air.Inst.Index, index: u8) !CValue
49874986
49884987 if (f.liveness.isUnused(inst)) {
49894988 try reap(f, inst, &.{ty_op.operand});
4990 // TODO this @as is needed because of a stage1 bug
4991 return @as(CValue, CValue.none);
4989 return .none;
49924990 }
49934991
49944992 const struct_ptr = try f.resolveInst(ty_op.operand);
src/codegen/llvm.zig+8-8
......@@ -1392,8 +1392,9 @@ pub const Object = struct {
13921392 const dir_path = file.pkg.root_src_directory.path orelse ".";
13931393 const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path));
13941394 defer gpa.free(sub_file_path_z);
1395 const stage1_workaround = std.fs.path.dirname(file.sub_file_path) orelse "";
1396 const dir_path_z = try std.fs.path.joinZ(gpa, &.{ dir_path, stage1_workaround });
1395 const dir_path_z = try std.fs.path.joinZ(gpa, &.{
1396 dir_path, std.fs.path.dirname(file.sub_file_path) orelse "",
1397 });
13971398 defer gpa.free(dir_path_z);
13981399 const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z);
13991400 gop.value_ptr.* = di_file.toNode();
......@@ -6107,12 +6108,11 @@ pub const FuncGen = struct {
61076108 }
61086109
61096110 fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) !?*llvm.Value {
6110 // Eventually, the Zig compiler needs to be reworked to have inline assembly go
6111 // through the same parsing code regardless of backend, and have LLVM-flavored
6112 // inline assembly be *output* from that assembler.
6113 // We don't have such an assembler implemented yet though. For now, this
6114 // implementation feeds the inline assembly code directly to LLVM, same
6115 // as stage1.
6111 // Eventually, the Zig compiler needs to be reworked to have inline
6112 // assembly go through the same parsing code regardless of backend, and
6113 // have LLVM-flavored inline assembly be *output* from that assembler.
6114 // We don't have such an assembler implemented yet though. For now,
6115 // this implementation feeds the inline assembly code directly to LLVM.
61166116
61176117 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
61186118 const extra = self.air.extraData(Air.Asm, ty_pl.payload);
src/codegen/spirv/Section.zig-10
......@@ -333,8 +333,6 @@ fn extendedUnionSize(comptime Operand: type, operand: Operand) usize {
333333}
334334
335335test "SPIR-V Section emit() - no operands" {
336 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
337
338336 var section = Section{};
339337 defer section.deinit(std.testing.allocator);
340338
......@@ -344,8 +342,6 @@ test "SPIR-V Section emit() - no operands" {
344342}
345343
346344test "SPIR-V Section emit() - simple" {
347 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
348
349345 var section = Section{};
350346 defer section.deinit(std.testing.allocator);
351347
......@@ -362,8 +358,6 @@ test "SPIR-V Section emit() - simple" {
362358}
363359
364360test "SPIR-V Section emit() - string" {
365 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
366
367361 var section = Section{};
368362 defer section.deinit(std.testing.allocator);
369363
......@@ -389,8 +383,6 @@ test "SPIR-V Section emit() - string" {
389383}
390384
391385test "SPIR-V Section emit()- extended mask" {
392 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
393
394386 var section = Section{};
395387 defer section.deinit(std.testing.allocator);
396388
......@@ -415,8 +407,6 @@ test "SPIR-V Section emit()- extended mask" {
415407}
416408
417409test "SPIR-V Section emit() - extended union" {
418 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
419
420410 var section = Section{};
421411 defer section.deinit(std.testing.allocator);
422412
src/main.zig+2-6
......@@ -3289,15 +3289,11 @@ fn parseCrossTargetOrReportFatalError(
32893289 fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
32903290 },
32913291 error.UnknownObjectFormat => {
3292 {
3292 help: {
32933293 var help_text = std.ArrayList(u8).init(allocator);
32943294 defer help_text.deinit();
32953295 inline for (@typeInfo(std.Target.ObjectFormat).Enum.fields) |field| {
3296 help_text.writer().print(" {s}\n", .{field.name}) catch
3297 // TODO change this back to `break :help`
3298 // this working around a stage1 bug.
3299 //break :help;
3300 @panic("out of memory");
3296 help_text.writer().print(" {s}\n", .{field.name}) catch break :help;
33013297 }
33023298 std.log.info("available object formats:\n{s}", .{help_text.items});
33033299 }
src/print_air.zig+1-1
......@@ -848,7 +848,7 @@ const Writer = struct {
848848 if ((bits >> 31) != 0) break :blk false;
849849 extra_index += 1;
850850 tomb_op_index += 31;
851 } else unreachable;
851 }
852852 };
853853 return w.writeInstRef(s, operand, dies);
854854 }
src/target.zig+2-2
......@@ -523,13 +523,13 @@ pub const AtomicPtrAlignmentDiagnostics = struct {
523523/// If ABI alignment of `ty` is OK for atomic operations, returns 0.
524524/// Otherwise returns the alignment required on a pointer for the target
525525/// to perform atomic operations.
526// TODO this function does not take into account CPU features, which can affect
527// this value. Audit this!
526528pub fn atomicPtrAlignment(
527529 target: std.Target,
528530 ty: Type,
529531 diags: *AtomicPtrAlignmentDiagnostics,
530532) AtomicPtrAlignmentError!u32 {
531 // TODO this was ported from stage1 but it does not take into account CPU features,
532 // which can affect this value. Audit this!
533533 const max_atomic_bits: u16 = switch (target.cpu.arch) {
534534 .avr,
535535 .msp430,
src/translate_c.zig+2-5
......@@ -1,6 +1,3 @@
1//! This is the userland implementation of translate-c which is used by both stage1
2//! and stage2.
3
41const std = @import("std");
52const testing = std.testing;
63const assert = std.debug.assert;
......@@ -523,7 +520,7 @@ fn declVisitorNamesOnly(c: *Context, decl: *const clang.Decl) Error!void {
523520 child_ty = macroqualified_ty.getModifiedType().getTypePtr();
524521 },
525522 else => return,
526 } else unreachable;
523 };
527524
528525 const result = try c.unnamed_typedefs.getOrPut(c.gpa, addr);
529526 if (result.found_existing) {
......@@ -629,7 +626,7 @@ fn visitFnDecl(c: *Context, fn_decl: *const clang.FunctionDecl) Error!void {
629626 },
630627 else => break fn_type,
631628 }
632 } else unreachable;
629 };
633630 const fn_ty = @ptrCast(*const clang.FunctionType, fn_type);
634631 const return_qt = fn_ty.getReturnType();
635632
src/type.zig+4-6
......@@ -1554,10 +1554,10 @@ pub const Type = extern union {
15541554 ) @TypeOf(writer).Error!void {
15551555 _ = options;
15561556 comptime assert(unused_format_string.len == 0);
1557 if (@import("builtin").zig_backend != .stage1) {
1558 // This is disabled to work around a stage2 bug where this function recursively
1559 // causes more generic function instantiations resulting in an infinite loop
1560 // in the compiler.
1557 if (true) {
1558 // This is disabled to work around a bug where this function
1559 // recursively causes more generic function instantiations
1560 // resulting in an infinite loop in the compiler.
15611561 try writer.writeAll("[TODO fix internal compiler bug regarding dump]");
15621562 return;
15631563 }
......@@ -6551,9 +6551,7 @@ pub const Type = extern union {
65516551 else => {},
65526552 }
65536553 } else {
6554 // TODO stage1 type inference bug
65556554 const T = Type.Tag;
6556
65576555 const type_payload = try arena.create(Type.Payload.ElemType);
65586556 type_payload.* = .{
65596557 .base = .{
src/zig_llvm.h-2
......@@ -337,7 +337,6 @@ ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const
337337
338338// synchronize with llvm/include/ADT/Triple.h::ArchType
339339// synchronize with std.Target.Cpu.Arch
340// synchronize with src/stage1/target.cpp::arch_list
341340// synchronize with codegen/llvm/bindings.zig::ArchType
342341enum ZigLLVM_ArchType {
343342 ZigLLVM_UnknownArch,
......@@ -428,7 +427,6 @@ enum ZigLLVM_VendorType {
428427// synchronize with llvm/include/ADT/Triple.h::OsType
429428// synchronize with std.Target.Os.Tag
430429// synchronize with codegen/llvm/bindings.zig::OsType
431// synchronize with src/stage1/target.cpp::os_list
432430enum ZigLLVM_OSType {
433431 ZigLLVM_UnknownOS,
434432
test/behavior.zig+9-12
......@@ -94,6 +94,8 @@ test {
9494 _ = @import("behavior/bugs/12551.zig");
9595 _ = @import("behavior/bugs/12644.zig");
9696 _ = @import("behavior/bugs/12680.zig");
97 _ = @import("behavior/bugs/12723.zig");
98 _ = @import("behavior/bugs/12776.zig");
9799 _ = @import("behavior/bugs/12786.zig");
98100 _ = @import("behavior/bugs/12794.zig");
99101 _ = @import("behavior/bugs/12801-1.zig");
......@@ -112,8 +114,8 @@ test {
112114 _ = @import("behavior/bugs/13069.zig");
113115 _ = @import("behavior/bugs/13112.zig");
114116 _ = @import("behavior/bugs/13128.zig");
115 _ = @import("behavior/bugs/13164.zig");
116117 _ = @import("behavior/bugs/13159.zig");
118 _ = @import("behavior/bugs/13164.zig");
117119 _ = @import("behavior/bugs/13171.zig");
118120 _ = @import("behavior/bugs/13285.zig");
119121 _ = @import("behavior/bugs/13435.zig");
......@@ -126,7 +128,9 @@ test {
126128 _ = @import("behavior/cast_int.zig");
127129 _ = @import("behavior/comptime_memory.zig");
128130 _ = @import("behavior/const_slice_child.zig");
131 _ = @import("behavior/decltest.zig");
129132 _ = @import("behavior/defer.zig");
133 _ = @import("behavior/empty_union.zig");
130134 _ = @import("behavior/enum.zig");
131135 _ = @import("behavior/error.zig");
132136 _ = @import("behavior/eval.zig");
......@@ -142,6 +146,7 @@ test {
142146 _ = @import("behavior/if.zig");
143147 _ = @import("behavior/import.zig");
144148 _ = @import("behavior/incomplete_struct_param_tld.zig");
149 _ = @import("behavior/inline_switch.zig");
145150 _ = @import("behavior/int128.zig");
146151 _ = @import("behavior/int_div.zig");
147152 _ = @import("behavior/inttoptr.zig");
......@@ -154,6 +159,8 @@ test {
154159 _ = @import("behavior/namespace_depends_on_compile_var.zig");
155160 _ = @import("behavior/null.zig");
156161 _ = @import("behavior/optional.zig");
162 _ = @import("behavior/packed-struct.zig");
163 _ = @import("behavior/packed_struct_explicit_backing_int.zig");
157164 _ = @import("behavior/pointers.zig");
158165 _ = @import("behavior/popcount.zig");
159166 _ = @import("behavior/prefetch.zig");
......@@ -169,7 +176,6 @@ test {
169176 _ = @import("behavior/slice_sentinel_comptime.zig");
170177 _ = @import("behavior/src.zig");
171178 _ = @import("behavior/struct.zig");
172 _ = @import("behavior/packed-struct.zig");
173179 _ = @import("behavior/struct_contains_null_ptr_itself.zig");
174180 _ = @import("behavior/struct_contains_slice_of_itself.zig");
175181 _ = @import("behavior/switch.zig");
......@@ -180,6 +186,7 @@ test {
180186 _ = @import("behavior/truncate.zig");
181187 _ = @import("behavior/try.zig");
182188 _ = @import("behavior/tuple.zig");
189 _ = @import("behavior/tuple_declarations.zig");
183190 _ = @import("behavior/type.zig");
184191 _ = @import("behavior/type_info.zig");
185192 _ = @import("behavior/typename.zig");
......@@ -198,16 +205,6 @@ test {
198205 _ = @import("behavior/wasm.zig");
199206 }
200207
201 if (builtin.zig_backend != .stage1) {
202 _ = @import("behavior/decltest.zig");
203 _ = @import("behavior/packed_struct_explicit_backing_int.zig");
204 _ = @import("behavior/empty_union.zig");
205 _ = @import("behavior/inline_switch.zig");
206 _ = @import("behavior/tuple_declarations.zig");
207 _ = @import("behavior/bugs/12723.zig");
208 _ = @import("behavior/bugs/12776.zig");
209 }
210
211208 if (builtin.os.tag != .wasi) {
212209 _ = @import("behavior/asm.zig");
213210 }
test/behavior/align.zig+1-15
......@@ -16,7 +16,6 @@ test "global variable alignment" {
1616}
1717
1818test "slicing array of length 1 can not assume runtime index is always zero" {
19 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
2019 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
2120 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2221
......@@ -61,10 +60,6 @@ test "alignment of struct with pointer has same alignment as usize" {
6160}
6261
6362test "alignment and size of structs with 128-bit fields" {
64 if (builtin.zig_backend == .stage1) {
65 // stage1 gets the wrong answer for a lot of targets
66 return error.SkipZigTest;
67 }
6863 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
6964 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
7065
......@@ -313,7 +308,6 @@ test "function alignment" {
313308}
314309
315310test "implicitly decreasing fn alignment" {
316 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
317311 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
318312 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
319313
......@@ -337,7 +331,6 @@ fn alignedBig() align(16) i32 {
337331
338332test "@alignCast functions" {
339333 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
340 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
341334 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
342335
343336 // function alignment is a compile error on wasm32/wasm64
......@@ -380,8 +373,6 @@ test "function align expression depends on generic parameter" {
380373}
381374
382375test "function callconv expression depends on generic parameter" {
383 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
384
385376 const S = struct {
386377 fn doTheTest() !void {
387378 try expect(foobar(.C, 1) == 2);
......@@ -435,8 +426,6 @@ fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void {
435426}
436427
437428test "alignment of function with c calling convention" {
438 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
439
440429 var runtime_nothing = &nothing;
441430 const casted1 = @ptrCast(*const u8, runtime_nothing);
442431 const casted2 = @ptrCast(*const fn () callconv(.C) void, casted1);
......@@ -495,7 +484,7 @@ test "struct field explicit alignment" {
495484}
496485
497486test "align(@alignOf(T)) T does not force resolution of T" {
498 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
487 if (true) return error.SkipZigTest; // TODO
499488
500489 const S = struct {
501490 const A = struct {
......@@ -519,7 +508,6 @@ test "align(@alignOf(T)) T does not force resolution of T" {
519508}
520509
521510test "align(N) on functions" {
522 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
523511 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
524512 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
525513 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -557,8 +545,6 @@ test "@alignCast null" {
557545}
558546
559547test "alignment of slice element" {
560 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
561
562548 const a: []align(1024) const u8 = undefined;
563549 try expect(@TypeOf(&a[0]) == *align(1024) const u8);
564550}
test/behavior/array.zig-6
......@@ -102,12 +102,6 @@ test "array len field" {
102102}
103103
104104test "array with sentinels" {
105 if (builtin.zig_backend == .stage1) {
106 // Stage1 test coverage disabled at runtime because of
107 // https://github.com/ziglang/zig/issues/4372
108 return error.SkipZigTest;
109 }
110
111105 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
112106
113107 const S = struct {
test/behavior/async_fn.zig+66-66
......@@ -8,7 +8,7 @@ const expectError = std.testing.expectError;
88var global_x: i32 = 1;
99
1010test "simple coroutine suspend and resume" {
11 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
11 if (true) return error.SkipZigTest; // TODO
1212 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1313
1414 var frame = async simpleAsyncFn();
......@@ -31,7 +31,7 @@ fn simpleAsyncFn() void {
3131var global_y: i32 = 1;
3232
3333test "pass parameter to coroutine" {
34 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
34 if (true) return error.SkipZigTest; // TODO
3535 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
3636
3737 var p = async simpleAsyncFnWithArg(2);
......@@ -46,7 +46,7 @@ fn simpleAsyncFnWithArg(delta: i32) void {
4646}
4747
4848test "suspend at end of function" {
49 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
49 if (true) return error.SkipZigTest; // TODO
5050 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
5151
5252 const S = struct {
......@@ -68,7 +68,7 @@ test "suspend at end of function" {
6868}
6969
7070test "local variable in async function" {
71 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
71 if (true) return error.SkipZigTest; // TODO
7272 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
7373
7474 const S = struct {
......@@ -100,7 +100,7 @@ test "local variable in async function" {
100100}
101101
102102test "calling an inferred async function" {
103 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
103 if (true) return error.SkipZigTest; // TODO
104104 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
105105
106106 const S = struct {
......@@ -127,7 +127,7 @@ test "calling an inferred async function" {
127127}
128128
129129test "@frameSize" {
130 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
130 if (true) return error.SkipZigTest; // TODO
131131 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
132132
133133 if (builtin.target.cpu.arch == .thumb or builtin.target.cpu.arch == .thumbeb)
......@@ -161,7 +161,7 @@ test "@frameSize" {
161161}
162162
163163test "coroutine suspend, resume" {
164 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
164 if (true) return error.SkipZigTest; // TODO
165165 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
166166
167167 const S = struct {
......@@ -205,7 +205,7 @@ test "coroutine suspend, resume" {
205205}
206206
207207test "coroutine suspend with block" {
208 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
208 if (true) return error.SkipZigTest; // TODO
209209 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
210210
211211 const p = async testSuspendBlock();
......@@ -234,7 +234,7 @@ var await_a_promise: anyframe = undefined;
234234var await_final_result: i32 = 0;
235235
236236test "coroutine await" {
237 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
237 if (true) return error.SkipZigTest; // TODO
238238 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
239239
240240 await_seq('a');
......@@ -274,7 +274,7 @@ fn await_seq(c: u8) void {
274274var early_final_result: i32 = 0;
275275
276276test "coroutine await early return" {
277 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
277 if (true) return error.SkipZigTest; // TODO
278278 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
279279
280280 early_seq('a');
......@@ -305,7 +305,7 @@ fn early_seq(c: u8) void {
305305}
306306
307307test "async function with dot syntax" {
308 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
308 if (true) return error.SkipZigTest; // TODO
309309 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
310310
311311 const S = struct {
......@@ -321,7 +321,7 @@ test "async function with dot syntax" {
321321}
322322
323323test "async fn pointer in a struct field" {
324 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
324 if (true) return error.SkipZigTest; // TODO
325325 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
326326
327327 var data: i32 = 1;
......@@ -349,7 +349,7 @@ fn simpleAsyncFn2(y: *i32) callconv(.Async) void {
349349}
350350
351351test "@asyncCall with return type" {
352 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
352 if (true) return error.SkipZigTest; // TODO
353353 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
354354
355355 const Foo = struct {
......@@ -376,7 +376,7 @@ test "@asyncCall with return type" {
376376}
377377
378378test "async fn with inferred error set" {
379 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
379 if (true) return error.SkipZigTest; // TODO
380380 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
381381
382382 const S = struct {
......@@ -409,7 +409,7 @@ test "async fn with inferred error set" {
409409}
410410
411411test "error return trace across suspend points - early return" {
412 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
412 if (true) return error.SkipZigTest; // TODO
413413 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
414414
415415 const p = nonFailing();
......@@ -419,7 +419,7 @@ test "error return trace across suspend points - early return" {
419419}
420420
421421test "error return trace across suspend points - async return" {
422 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
422 if (true) return error.SkipZigTest; // TODO
423423 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
424424
425425 const p = nonFailing();
......@@ -452,7 +452,7 @@ fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {
452452}
453453
454454test "break from suspend" {
455 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
455 if (true) return error.SkipZigTest; // TODO
456456 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
457457
458458 var my_result: i32 = 1;
......@@ -470,7 +470,7 @@ fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {
470470}
471471
472472test "heap allocated async function frame" {
473 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
473 if (true) return error.SkipZigTest; // TODO
474474 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
475475
476476 const S = struct {
......@@ -497,7 +497,7 @@ test "heap allocated async function frame" {
497497}
498498
499499test "async function call return value" {
500 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
500 if (true) return error.SkipZigTest; // TODO
501501 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
502502
503503 const S = struct {
......@@ -541,7 +541,7 @@ test "async function call return value" {
541541}
542542
543543test "suspension points inside branching control flow" {
544 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
544 if (true) return error.SkipZigTest; // TODO
545545 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
546546
547547 const S = struct {
......@@ -570,7 +570,7 @@ test "suspension points inside branching control flow" {
570570}
571571
572572test "call async function which has struct return type" {
573 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
573 if (true) return error.SkipZigTest; // TODO
574574 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
575575
576576 const S = struct {
......@@ -606,7 +606,7 @@ test "call async function which has struct return type" {
606606}
607607
608608test "pass string literal to async function" {
609 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
609 if (true) return error.SkipZigTest; // TODO
610610 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
611611
612612 const S = struct {
......@@ -630,7 +630,7 @@ test "pass string literal to async function" {
630630}
631631
632632test "await inside an errdefer" {
633 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
633 if (true) return error.SkipZigTest; // TODO
634634 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
635635
636636 const S = struct {
......@@ -656,7 +656,7 @@ test "await inside an errdefer" {
656656}
657657
658658test "try in an async function with error union and non-zero-bit payload" {
659 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
659 if (true) return error.SkipZigTest; // TODO
660660 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
661661
662662 const S = struct {
......@@ -689,7 +689,7 @@ test "try in an async function with error union and non-zero-bit payload" {
689689}
690690
691691test "returning a const error from async function" {
692 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
692 if (true) return error.SkipZigTest; // TODO
693693 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
694694
695695 const S = struct {
......@@ -723,7 +723,7 @@ test "returning a const error from async function" {
723723}
724724
725725test "async/await typical usage" {
726 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
726 if (true) return error.SkipZigTest; // TODO
727727 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
728728
729729 inline for ([_]bool{ false, true }) |b1| {
......@@ -821,7 +821,7 @@ fn testAsyncAwaitTypicalUsage(
821821}
822822
823823test "alignment of local variables in async functions" {
824 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
824 if (true) return error.SkipZigTest; // TODO
825825 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
826826
827827 const S = struct {
......@@ -836,7 +836,7 @@ test "alignment of local variables in async functions" {
836836}
837837
838838test "no reason to resolve frame still works" {
839 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
839 if (true) return error.SkipZigTest; // TODO
840840 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
841841
842842 _ = async simpleNothing();
......@@ -847,7 +847,7 @@ fn simpleNothing() void {
847847}
848848
849849test "async call a generic function" {
850 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
850 if (true) return error.SkipZigTest; // TODO
851851 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
852852
853853 const S = struct {
......@@ -870,7 +870,7 @@ test "async call a generic function" {
870870}
871871
872872test "return from suspend block" {
873 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
873 if (true) return error.SkipZigTest; // TODO
874874 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
875875
876876 const S = struct {
......@@ -887,7 +887,7 @@ test "return from suspend block" {
887887}
888888
889889test "struct parameter to async function is copied to the frame" {
890 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
890 if (true) return error.SkipZigTest; // TODO
891891 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
892892
893893 const S = struct {
......@@ -934,7 +934,7 @@ test "struct parameter to async function is copied to the frame" {
934934}
935935
936936test "cast fn to async fn when it is inferred to be async" {
937 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
937 if (true) return error.SkipZigTest; // TODO
938938 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
939939
940940 const S = struct {
......@@ -965,7 +965,7 @@ test "cast fn to async fn when it is inferred to be async" {
965965}
966966
967967test "cast fn to async fn when it is inferred to be async, awaited directly" {
968 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
968 if (true) return error.SkipZigTest; // TODO
969969 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
970970
971971 const S = struct {
......@@ -995,7 +995,7 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {
995995}
996996
997997test "await does not force async if callee is blocking" {
998 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
998 if (true) return error.SkipZigTest; // TODO
999999 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10001000
10011001 const S = struct {
......@@ -1008,7 +1008,7 @@ test "await does not force async if callee is blocking" {
10081008}
10091009
10101010test "recursive async function" {
1011 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1011 if (true) return error.SkipZigTest; // TODO
10121012 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10131013
10141014 try expect(recursiveAsyncFunctionTest(false).doTheTest() == 55);
......@@ -1073,7 +1073,7 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type {
10731073}
10741074
10751075test "@asyncCall with comptime-known function, but not awaited directly" {
1076 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1076 if (true) return error.SkipZigTest; // TODO
10771077 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10781078
10791079 const S = struct {
......@@ -1105,7 +1105,7 @@ test "@asyncCall with comptime-known function, but not awaited directly" {
11051105}
11061106
11071107test "@asyncCall with actual frame instead of byte buffer" {
1108 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1108 if (true) return error.SkipZigTest; // TODO
11091109 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11101110
11111111 const S = struct {
......@@ -1122,7 +1122,7 @@ test "@asyncCall with actual frame instead of byte buffer" {
11221122}
11231123
11241124test "@asyncCall using the result location inside the frame" {
1125 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1125 if (true) return error.SkipZigTest; // TODO
11261126 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11271127
11281128 const S = struct {
......@@ -1152,7 +1152,7 @@ test "@asyncCall using the result location inside the frame" {
11521152}
11531153
11541154test "@TypeOf an async function call of generic fn with error union type" {
1155 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1155 if (true) return error.SkipZigTest; // TODO
11561156 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11571157
11581158 const S = struct {
......@@ -1166,7 +1166,7 @@ test "@TypeOf an async function call of generic fn with error union type" {
11661166}
11671167
11681168test "using @TypeOf on a generic function call" {
1169 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1169 if (true) return error.SkipZigTest; // TODO
11701170 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11711171
11721172 const S = struct {
......@@ -1194,7 +1194,7 @@ test "using @TypeOf on a generic function call" {
11941194}
11951195
11961196test "recursive call of await @asyncCall with struct return type" {
1197 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1197 if (true) return error.SkipZigTest; // TODO
11981198 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11991199
12001200 const S = struct {
......@@ -1233,7 +1233,7 @@ test "recursive call of await @asyncCall with struct return type" {
12331233}
12341234
12351235test "nosuspend function call" {
1236 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1236 if (true) return error.SkipZigTest; // TODO
12371237 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12381238
12391239 const S = struct {
......@@ -1252,7 +1252,7 @@ test "nosuspend function call" {
12521252}
12531253
12541254test "await used in expression and awaiting fn with no suspend but async calling convention" {
1255 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1255 if (true) return error.SkipZigTest; // TODO
12561256 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12571257
12581258 const S = struct {
......@@ -1271,7 +1271,7 @@ test "await used in expression and awaiting fn with no suspend but async calling
12711271}
12721272
12731273test "await used in expression after a fn call" {
1274 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1274 if (true) return error.SkipZigTest; // TODO
12751275 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12761276
12771277 const S = struct {
......@@ -1292,7 +1292,7 @@ test "await used in expression after a fn call" {
12921292}
12931293
12941294test "async fn call used in expression after a fn call" {
1295 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1295 if (true) return error.SkipZigTest; // TODO
12961296 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12971297
12981298 const S = struct {
......@@ -1312,7 +1312,7 @@ test "async fn call used in expression after a fn call" {
13121312}
13131313
13141314test "suspend in for loop" {
1315 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1315 if (true) return error.SkipZigTest; // TODO
13161316 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13171317
13181318 const S = struct {
......@@ -1341,7 +1341,7 @@ test "suspend in for loop" {
13411341}
13421342
13431343test "suspend in while loop" {
1344 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1344 if (true) return error.SkipZigTest; // TODO
13451345 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13461346
13471347 const S = struct {
......@@ -1381,7 +1381,7 @@ test "suspend in while loop" {
13811381}
13821382
13831383test "correctly spill when returning the error union result of another async fn" {
1384 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1384 if (true) return error.SkipZigTest; // TODO
13851385 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13861386
13871387 const S = struct {
......@@ -1407,7 +1407,7 @@ test "correctly spill when returning the error union result of another async fn"
14071407}
14081408
14091409test "spill target expr in a for loop" {
1410 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1410 if (true) return error.SkipZigTest; // TODO
14111411 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14121412
14131413 const S = struct {
......@@ -1441,7 +1441,7 @@ test "spill target expr in a for loop" {
14411441}
14421442
14431443test "spill target expr in a for loop, with a var decl in the loop body" {
1444 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1444 if (true) return error.SkipZigTest; // TODO
14451445 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14461446
14471447 const S = struct {
......@@ -1480,7 +1480,7 @@ test "spill target expr in a for loop, with a var decl in the loop body" {
14801480}
14811481
14821482test "async call with @call" {
1483 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1483 if (true) return error.SkipZigTest; // TODO
14841484 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14851485
14861486 const S = struct {
......@@ -1505,7 +1505,7 @@ test "async call with @call" {
15051505}
15061506
15071507test "async function passed 0-bit arg after non-0-bit arg" {
1508 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1508 if (true) return error.SkipZigTest; // TODO
15091509 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15101510
15111511 const S = struct {
......@@ -1529,7 +1529,7 @@ test "async function passed 0-bit arg after non-0-bit arg" {
15291529}
15301530
15311531test "async function passed align(16) arg after align(8) arg" {
1532 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1532 if (true) return error.SkipZigTest; // TODO
15331533 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15341534
15351535 const S = struct {
......@@ -1554,7 +1554,7 @@ test "async function passed align(16) arg after align(8) arg" {
15541554}
15551555
15561556test "async function call resolves target fn frame, comptime func" {
1557 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1557 if (true) return error.SkipZigTest; // TODO
15581558 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15591559
15601560 const S = struct {
......@@ -1579,7 +1579,7 @@ test "async function call resolves target fn frame, comptime func" {
15791579}
15801580
15811581test "async function call resolves target fn frame, runtime func" {
1582 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1582 if (true) return error.SkipZigTest; // TODO
15831583 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15841584
15851585 const S = struct {
......@@ -1605,7 +1605,7 @@ test "async function call resolves target fn frame, runtime func" {
16051605}
16061606
16071607test "properly spill optional payload capture value" {
1608 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1608 if (true) return error.SkipZigTest; // TODO
16091609 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16101610
16111611 const S = struct {
......@@ -1632,7 +1632,7 @@ test "properly spill optional payload capture value" {
16321632}
16331633
16341634test "handle defer interfering with return value spill" {
1635 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1635 if (true) return error.SkipZigTest; // TODO
16361636 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16371637
16381638 const S = struct {
......@@ -1675,7 +1675,7 @@ test "handle defer interfering with return value spill" {
16751675}
16761676
16771677test "take address of temporary async frame" {
1678 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1678 if (true) return error.SkipZigTest; // TODO
16791679 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16801680
16811681 const S = struct {
......@@ -1707,7 +1707,7 @@ test "take address of temporary async frame" {
17071707}
17081708
17091709test "nosuspend await" {
1710 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1710 if (true) return error.SkipZigTest; // TODO
17111711 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17121712
17131713 const S = struct {
......@@ -1731,7 +1731,7 @@ test "nosuspend await" {
17311731}
17321732
17331733test "nosuspend on function calls" {
1734 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1734 if (true) return error.SkipZigTest; // TODO
17351735 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17361736
17371737 const S0 = struct {
......@@ -1750,7 +1750,7 @@ test "nosuspend on function calls" {
17501750}
17511751
17521752test "nosuspend on async function calls" {
1753 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1753 if (true) return error.SkipZigTest; // TODO
17541754 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17551755
17561756 const S0 = struct {
......@@ -1771,7 +1771,7 @@ test "nosuspend on async function calls" {
17711771}
17721772
17731773// test "resume nosuspend async function calls" {
1774// if (builtin.zig_backend != .stage1) return error.SkipZigTest; // if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1774// if (true) return error.SkipZigTest; // if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17751775// const S0 = struct {
17761776// b: i32 = 42,
17771777// };
......@@ -1794,7 +1794,7 @@ test "nosuspend on async function calls" {
17941794// }
17951795
17961796test "nosuspend resume async function calls" {
1797 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1797 if (true) return error.SkipZigTest; // TODO
17981798 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17991799
18001800 const S0 = struct {
......@@ -1819,7 +1819,7 @@ test "nosuspend resume async function calls" {
18191819}
18201820
18211821test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
1822 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1822 if (true) return error.SkipZigTest; // TODO
18231823 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18241824
18251825 const S = struct {
......@@ -1838,7 +1838,7 @@ test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
18381838}
18391839
18401840test "@asyncCall with pass-by-value arguments" {
1841 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1841 if (true) return error.SkipZigTest; // TODO
18421842 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18431843
18441844 const F0: u64 = 0xbeefbeefbeefbeef;
......@@ -1874,7 +1874,7 @@ test "@asyncCall with pass-by-value arguments" {
18741874}
18751875
18761876test "@asyncCall with arguments having non-standard alignment" {
1877 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1877 if (true) return error.SkipZigTest; // TODO
18781878 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18791879
18801880 const F0: u64 = 0xbeefbeef;
test/behavior/atomics.zig+3-5
......@@ -151,9 +151,7 @@ test "cmpxchg on a global variable" {
151151 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
152152 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
153153
154 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
155 builtin.cpu.arch == .aarch64)
156 {
154 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
157155 // https://github.com/ziglang/zig/issues/10627
158156 return error.SkipZigTest;
159157 }
......@@ -220,8 +218,8 @@ test "atomicrmw with floats" {
220218 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
221219 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
222220
223 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm or
224 builtin.zig_backend == .stage2_c) and builtin.cpu.arch == .aarch64)
221 if ((builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) and
222 builtin.cpu.arch == .aarch64)
225223 {
226224 // https://github.com/ziglang/zig/issues/10627
227225 return error.SkipZigTest;
test/behavior/await_struct.zig+1-1
......@@ -10,7 +10,7 @@ var await_a_promise: anyframe = undefined;
1010var await_final_result = Foo{ .x = 0 };
1111
1212test "coroutine await struct" {
13 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
13 if (true) return error.SkipZigTest; // TODO
1414
1515 await_seq('a');
1616 var p = async await_amain();
test/behavior/basic.zig+1-19
......@@ -198,11 +198,6 @@ const OpaqueA = opaque {};
198198const OpaqueB = opaque {};
199199
200200test "opaque types" {
201 if (builtin.zig_backend == .stage1) {
202 // stage1 gets the type names wrong
203 return error.SkipZigTest;
204 }
205
206201 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
207202
208203 try expect(*OpaqueA != *OpaqueB);
......@@ -290,7 +285,6 @@ fn fB() []const u8 {
290285
291286test "call function pointer in struct" {
292287 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
293 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
294288
295289 try expect(mem.eql(u8, f3(true), "a"));
296290 try expect(mem.eql(u8, f3(false), "b"));
......@@ -329,7 +323,6 @@ fn copy(src: *const u64, dst: *u64) void {
329323}
330324
331325test "call result of if else expression" {
332 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers
333326 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
334327 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
335328 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -573,22 +566,16 @@ fn emptyFn() void {}
573566
574567const addr1 = @ptrCast(*const u8, &emptyFn);
575568test "comptime cast fn to ptr" {
576 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
577
578569 const addr2 = @ptrCast(*const u8, &emptyFn);
579570 comptime try expect(addr1 == addr2);
580571}
581572
582573test "equality compare fn ptrs" {
583 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
584
585574 var a = &emptyFn;
586575 try expect(a == a);
587576}
588577
589578test "self reference through fn ptr field" {
590 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
591
592579 const S = struct {
593580 const A = struct {
594581 f: *const fn (A) u8,
......@@ -783,10 +770,6 @@ test "auto created variables have correct alignment" {
783770}
784771
785772test "extern variable with non-pointer opaque type" {
786 if (builtin.zig_backend == .stage1) {
787 // Regressed with LLVM 14
788 return error.SkipZigTest;
789 }
790773 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
791774 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
792775 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -963,7 +946,7 @@ test "array type comes from generic function" {
963946}
964947
965948test "generic function uses return type of other generic function" {
966 if (builtin.zig_backend != .stage1) {
949 if (true) {
967950 // This test has been failing sporadically on the CI.
968951 // It's not enough to verify that it works locally; we need to diagnose why
969952 // it fails on the CI sometimes before turning it back on.
......@@ -1067,7 +1050,6 @@ test "inline call of function with a switch inside the return statement" {
10671050}
10681051
10691052test "namespace lookup ignores decl causing the lookup" {
1070 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10711053 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
10721054 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
10731055 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
test/behavior/bitcast.zig+1-7
......@@ -155,10 +155,6 @@ test "bitcast generates a temporary value" {
155155}
156156
157157test "@bitCast packed structs at runtime and comptime" {
158 if (builtin.zig_backend == .stage1) {
159 // stage1 gets the wrong answer for a lot of targets
160 return error.SkipZigTest;
161 }
162158 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
163159 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
164160 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -323,7 +319,6 @@ test "@bitCast packed struct of floats" {
323319}
324320
325321test "comptime @bitCast packed struct to int and back" {
326 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
327322 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
328323 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
329324 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -377,8 +372,7 @@ test "comptime bitcast with fields following f80" {
377372}
378373
379374test "bitcast vector to integer and back" {
380 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO: https://github.com/ziglang/zig/issues/13220
381 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the comptime cast wrong
375 if (true) return error.SkipZigTest; // TODO: https://github.com/ziglang/zig/issues/13220
382376
383377 const arr: [16]bool = [_]bool{ true, false } ++ [_]bool{true} ** 14;
384378 var x = @splat(16, true);
test/behavior/bitreverse.zig-6
......@@ -5,8 +5,6 @@ const minInt = std.math.minInt;
55
66test "@bitReverse large exotic integer" {
77 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
8 // Currently failing on stage1 for big-endian targets
9 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
108
119 try expect(@bitReverse(@as(u95, 0x123456789abcdef111213141)) == 0x4146424447bd9eac8f351624);
1210}
......@@ -96,7 +94,6 @@ fn vector8() !void {
9694}
9795
9896test "bitReverse vectors u8" {
99 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10097 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
10198 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
10299 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -115,7 +112,6 @@ fn vector16() !void {
115112}
116113
117114test "bitReverse vectors u16" {
118 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
119115 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
120116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
121117 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -134,7 +130,6 @@ fn vector24() !void {
134130}
135131
136132test "bitReverse vectors u24" {
137 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
138133 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
139134 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
140135 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -153,7 +148,6 @@ fn vector0() !void {
153148}
154149
155150test "bitReverse vectors u0" {
156 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
157151 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
158152 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
159153
test/behavior/bugs/10147.zig+1-4
......@@ -1,8 +1,7 @@
11const builtin = @import("builtin");
22const std = @import("std");
33
4test "uses correct LLVM builtin" {
5 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
4test "test calling @clz on both vector and scalar inputs" {
65 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
76 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
87 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -11,8 +10,6 @@ test "uses correct LLVM builtin" {
1110
1211 var x: u32 = 0x1;
1312 var y: @Vector(4, u32) = [_]u32{ 0x1, 0x1, 0x1, 0x1 };
14 // The stage1 compiler used to call the same builtin function for both
15 // scalar and vector inputs, causing the LLVM module verification to fail.
1613 var a = @clz(x);
1714 var b = @clz(y);
1815 try std.testing.expectEqual(@as(u6, 31), a);
test/behavior/bugs/11159.zig-2
......@@ -8,8 +8,6 @@ test {
88}
99
1010test {
11 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
12
1311 const S = struct {
1412 comptime x: i32 = 0,
1513 comptime y: u32 = 0,
test/behavior/bugs/11162.zig+2-3
......@@ -2,9 +2,8 @@ const std = @import("std");
22const builtin = @import("builtin");
33const expect = std.testing.expect;
44
5test "aggregate initializers should allow initializing comptime fields, verifying equality (stage2 only)" {
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
5test "aggregate initializers should allow initializing comptime fields, verifying equality" {
6 if (true) return error.SkipZigTest; // TODO
87
98 var x: u32 = 15;
109 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });
test/behavior/bugs/11227.zig-2
......@@ -6,8 +6,6 @@ fn foo() u32 {
66}
77const bar = foo;
88test "pointer to alias behaves same as pointer to function" {
9 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers
10
119 var a = &bar;
1210 try std.testing.expect(foo() == a());
1311}
test/behavior/bugs/11816.zig-1
......@@ -3,7 +3,6 @@ const builtin = @import("builtin");
33
44test {
55 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
76
87 var x: u32 = 3;
98 const val: usize = while (true) switch (x) {
test/behavior/bugs/12486.zig-2
......@@ -23,8 +23,6 @@ const ErrStruct = struct {
2323};
2424
2525test {
26 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
27
2826 _ = OptEnum{
2927 .opt_enum = .{
3028 .EnumVariant = 1,
test/behavior/bugs/12723.zig-3
......@@ -1,8 +1,5 @@
11const expect = @import("std").testing.expect;
22
3// This test causes a compile error on stage1 regardless of whether
4// the body of the test is comptime-gated or not. To workaround this,
5// we gate the inclusion of the test file.
63test "Non-exhaustive enum backed by comptime_int" {
74 const E = enum(comptime_int) { a, b, c, _ };
85 comptime var e: E = .a;
test/behavior/bugs/1277.zig-1
......@@ -12,7 +12,6 @@ fn f() i32 {
1212}
1313
1414test "don't emit an LLVM global for a const function when it's in an optional in a struct" {
15 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers
1615 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1716 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1817 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/bugs/12801-1.zig-1
......@@ -8,7 +8,6 @@ fn capacity_() u64 {
88
99test {
1010 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
11 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1211
1312 try std.testing.expect((@This(){}).capacity() == 64);
1413}
test/behavior/bugs/12801-2.zig-1
......@@ -14,7 +14,6 @@ const Auto = struct {
1414 }
1515};
1616test {
17 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1817 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1918 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2019 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/bugs/12885.zig-2
......@@ -11,8 +11,6 @@ const Foo = @Type(.{
1111 .ErrorSet = &info.args,
1212});
1313test "ErrorSet comptime_field_ptr" {
14 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
15
1614 try expect(Foo == error{bar});
1715}
1816
test/behavior/bugs/12891.zig-2
......@@ -7,8 +7,6 @@ test "issue12891" {
77 try std.testing.expect(i < f);
88}
99test "nan" {
10 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
11
1210 const f = comptime std.math.nan(f64);
1311 var i: usize = 0;
1412 try std.testing.expect(!(f < i));
test/behavior/bugs/12911.zig-2
......@@ -5,7 +5,5 @@ const Thing = struct {
55 array: [1]Item,
66};
77test {
8 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
9
108 _ = Thing{ .array = undefined };
119}
test/behavior/bugs/1310.zig+1-2
......@@ -22,7 +22,6 @@ fn agent_callback(_vm: [*]VM, options: [*]u8) callconv(.C) i32 {
2222 return 11;
2323}
2424
25test "fixed" {
26 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
25test {
2726 try expect(agent_callback(undefined, undefined) == 11);
2827}
test/behavior/bugs/2006.zig+1-8
......@@ -9,12 +9,5 @@ test "bug 2006" {
99 var a: S = undefined;
1010 a = S{ .p = undefined };
1111 try expect(@sizeOf(S) != 0);
12 if (@import("builtin").zig_backend != .stage1) {
13 // It is an accepted proposal to make `@sizeOf` for pointers independent
14 // of whether the element type is zero bits.
15 // This language change has not been implemented in stage1.
16 try expect(@sizeOf(*void) == @sizeOf(*i32));
17 } else {
18 try expect(@sizeOf(*void) == 0);
19 }
12 try expect(@sizeOf(*void) == @sizeOf(*i32));
2013}
test/behavior/bugs/3112.zig-1
......@@ -13,7 +13,6 @@ fn prev(p: ?State) void {
1313
1414test "zig test crash" {
1515 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1716 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1817 var global: State = undefined;
1918 global.enter = prev;
test/behavior/bugs/3779.zig-3
......@@ -6,7 +6,6 @@ const tag_name = @tagName(TestEnum.TestEnumValue);
66const ptr_tag_name: [*:0]const u8 = tag_name;
77
88test "@tagName() returns a string literal" {
9 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
109 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1110
1211 try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name));
......@@ -19,7 +18,6 @@ const error_name = @errorName(TestError.TestErrorCode);
1918const ptr_error_name: [*:0]const u8 = error_name;
2019
2120test "@errorName() returns a string literal" {
22 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
2321 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2422
2523 try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name));
......@@ -32,7 +30,6 @@ const type_name = @typeName(TestType);
3230const ptr_type_name: [*:0]const u8 = type_name;
3331
3432test "@typeName() returns a string literal" {
35 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
3633 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
3734
3835 try std.testing.expect(*const [type_name.len:0]u8 == @TypeOf(type_name));
test/behavior/bugs/6850.zig+1-7
......@@ -8,11 +8,5 @@ test "lazy sizeof comparison with zero" {
88}
99
1010fn hasNoBits(comptime T: type) bool {
11 if (@import("builtin").zig_backend != .stage1) {
12 // It is an accepted proposal to make `@sizeOf` for pointers independent
13 // of whether the element type is zero bits.
14 // This language change has not been implemented in stage1.
15 return @sizeOf(T) == @sizeOf(*i32);
16 }
17 return @sizeOf(T) == 0;
11 return @sizeOf(T) == @sizeOf(*i32);
1812}
test/behavior/bugs/920.zig+2-11
......@@ -2,23 +2,14 @@ const builtin = @import("builtin");
22const std = @import("std");
33const Random = std.rand.Random;
44
5const zeroCaseFn = switch (builtin.zig_backend) {
6 .stage1 => fn (*Random, f64) f64,
7 else => *const fn (*Random, f64) f64,
8};
9const pdfFn = switch (builtin.zig_backend) {
10 .stage1 => fn (f64) f64,
11 else => *const fn (f64) f64,
12};
13
145const ZigTable = struct {
156 r: f64,
167 x: [257]f64,
178 f: [257]f64,
189
19 pdf: pdfFn,
10 pdf: *const fn (f64) f64,
2011 is_symmetric: bool,
21 zero_case: zeroCaseFn,
12 zero_case: *const fn (*Random, f64) f64,
2213};
2314
2415fn ZigTableGen(comptime is_symmetric: bool, comptime r: f64, comptime v: f64, comptime f: fn (f64) f64, comptime f_inv: fn (f64) f64, comptime zero_case: fn (*Random, f64) f64) ZigTable {
test/behavior/byteswap.zig-5
......@@ -3,7 +3,6 @@ const builtin = @import("builtin");
33const expect = std.testing.expect;
44
55test "@byteSwap integers" {
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
76 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
87 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
98 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -62,7 +61,6 @@ fn vector8() !void {
6261}
6362
6463test "@byteSwap vectors u8" {
65 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
6664 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
6765 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
6866 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -81,7 +79,6 @@ fn vector16() !void {
8179}
8280
8381test "@byteSwap vectors u16" {
84 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
8582 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
8683 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
8784 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -100,7 +97,6 @@ fn vector24() !void {
10097}
10198
10299test "@byteSwap vectors u24" {
103 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
104100 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
105101 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
106102 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
......@@ -119,7 +115,6 @@ fn vector0() !void {
119115}
120116
121117test "@byteSwap vectors u0" {
122 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
123118 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
124119 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
125120
test/behavior/call.zig+4-10
......@@ -45,10 +45,7 @@ test "basic invocations" {
4545 }
4646 {
4747 // call of non comptime-known function
48 var alias_foo = switch (builtin.zig_backend) {
49 .stage1 => foo,
50 else => &foo,
51 };
48 var alias_foo = &foo;
5249 try expect(@call(.{ .modifier = .no_async }, alias_foo, .{}) == 1234);
5350 try expect(@call(.{ .modifier = .never_tail }, alias_foo, .{}) == 1234);
5451 try expect(@call(.{ .modifier = .never_inline }, alias_foo, .{}) == 1234);
......@@ -71,7 +68,9 @@ test "tuple parameters" {
7168 try expect(@call(.{}, add, .{ 12, b }) == 46);
7269 try expect(@call(.{}, add, .{ a, b }) == 46);
7370 try expect(@call(.{}, add, .{ 12, 34 }) == 46);
74 if (builtin.zig_backend == .stage1) comptime try expect(@call(.{}, add, .{ 12, 34 }) == 46); // TODO
71 if (false) {
72 comptime try expect(@call(.{}, add, .{ 12, 34 }) == 46); // TODO
73 }
7574 try expect(comptime @call(.{}, add, .{ 12, 34 }) == 46);
7675 {
7776 const separate_args0 = .{ a, b };
......@@ -246,8 +245,6 @@ test "function call with 40 arguments" {
246245}
247246
248247test "arguments to comptime parameters generated in comptime blocks" {
249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
250
251248 const S = struct {
252249 fn fortyTwo() i32 {
253250 return 42;
......@@ -261,7 +258,6 @@ test "arguments to comptime parameters generated in comptime blocks" {
261258}
262259
263260test "forced tail call" {
264 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
265261 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
266262 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
267263 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
......@@ -294,7 +290,6 @@ test "forced tail call" {
294290}
295291
296292test "inline call preserves tail call" {
297 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
298293 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
299294 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
300295 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
......@@ -329,7 +324,6 @@ test "inline call preserves tail call" {
329324}
330325
331326test "inline call doesn't re-evaluate non generic struct" {
332 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
333327 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
334328 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
335329 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/cast.zig-15
......@@ -113,8 +113,6 @@ test "@intToFloat" {
113113}
114114
115115test "@intToFloat(f80)" {
116 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
117
118116 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
119117 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
120118 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -699,11 +697,6 @@ test "peer type resolution: error set supersets" {
699697}
700698
701699test "peer type resolution: disjoint error sets" {
702 if (builtin.zig_backend == .stage1) {
703 // stage1 gets the order of the error names wrong after merging the sets.
704 return error.SkipZigTest;
705 }
706
707700 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
708701 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
709702 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -733,11 +726,6 @@ test "peer type resolution: disjoint error sets" {
733726}
734727
735728test "peer type resolution: error union and error set" {
736 if (builtin.zig_backend == .stage1) {
737 // stage1 gets the order of the error names wrong after merging the sets.
738 return error.SkipZigTest;
739 }
740
741729 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
742730 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
743731 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -1080,7 +1068,6 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void {
10801068}
10811069
10821070test "compile time int to ptr of function" {
1083 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10841071 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
10851072
10861073 try foobar(FUNCTION_CONSTANT);
......@@ -1421,8 +1408,6 @@ test "floatToInt to zero-bit int" {
14211408}
14221409
14231410test "peer type resolution of function pointer and function body" {
1424 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1425
14261411 const T = fn () u32;
14271412 const a: T = undefined;
14281413 const b: *const T = undefined;
test/behavior/comptime_memory.zig+11-32
......@@ -4,8 +4,6 @@ const testing = @import("std").testing;
44const ptr_size = @sizeOf(usize);
55
66test "type pun signed and unsigned as single pointer" {
7 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
8
97 comptime {
108 var x: u32 = 0;
119 const y = @ptrCast(*i32, &x);
......@@ -15,8 +13,6 @@ test "type pun signed and unsigned as single pointer" {
1513}
1614
1715test "type pun signed and unsigned as many pointer" {
18 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
19
2016 comptime {
2117 var x: u32 = 0;
2218 const y = @ptrCast([*]i32, &x);
......@@ -26,8 +22,6 @@ test "type pun signed and unsigned as many pointer" {
2622}
2723
2824test "type pun signed and unsigned as array pointer" {
29 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
30
3125 comptime {
3226 var x: u32 = 0;
3327 const y = @ptrCast(*[1]i32, &x);
......@@ -37,8 +31,7 @@ test "type pun signed and unsigned as array pointer" {
3731}
3832
3933test "type pun signed and unsigned as offset many pointer" {
40 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
41 if (builtin.zig_backend != .stage1) {
34 if (true) {
4235 // TODO https://github.com/ziglang/zig/issues/9646
4336 return error.SkipZigTest;
4437 }
......@@ -53,8 +46,7 @@ test "type pun signed and unsigned as offset many pointer" {
5346}
5447
5548test "type pun signed and unsigned as array pointer" {
56 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
57 if (builtin.zig_backend != .stage1) {
49 if (true) {
5850 // TODO https://github.com/ziglang/zig/issues/9646
5951 return error.SkipZigTest;
6052 }
......@@ -69,8 +61,6 @@ test "type pun signed and unsigned as array pointer" {
6961}
7062
7163test "type pun value and struct" {
72 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
73
7464 comptime {
7565 const StructOfU32 = extern struct { x: u32 };
7666 var inst: StructOfU32 = .{ .x = 0 };
......@@ -85,7 +75,6 @@ fn bigToNativeEndian(comptime T: type, v: T) T {
8575 return if (endian == .Big) v else @byteSwap(v);
8676}
8777test "type pun endianness" {
88 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
8978 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
9079
9180 comptime {
......@@ -179,8 +168,7 @@ fn doTypePunBitsTest(as_bits: *Bits) !void {
179168}
180169
181170test "type pun bits" {
182 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
183 if (builtin.zig_backend != .stage1) {
171 if (true) {
184172 // TODO https://github.com/ziglang/zig/issues/9646
185173 return error.SkipZigTest;
186174 }
......@@ -197,8 +185,7 @@ const imports = struct {
197185
198186// Make sure lazy values work on their own, before getting into more complex tests
199187test "basic pointer preservation" {
200 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
201 if (builtin.zig_backend != .stage1) {
188 if (true) {
202189 // TODO https://github.com/ziglang/zig/issues/9646
203190 return error.SkipZigTest;
204191 }
......@@ -211,8 +198,7 @@ test "basic pointer preservation" {
211198}
212199
213200test "byte copy preserves linker value" {
214 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
215 if (builtin.zig_backend != .stage1) {
201 if (true) {
216202 // TODO https://github.com/ziglang/zig/issues/9646
217203 return error.SkipZigTest;
218204 }
......@@ -235,8 +221,7 @@ test "byte copy preserves linker value" {
235221}
236222
237223test "unordered byte copy preserves linker value" {
238 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
239 if (builtin.zig_backend != .stage1) {
224 if (true) {
240225 // TODO https://github.com/ziglang/zig/issues/9646
241226 return error.SkipZigTest;
242227 }
......@@ -260,8 +245,7 @@ test "unordered byte copy preserves linker value" {
260245}
261246
262247test "shuffle chunks of linker value" {
263 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
264 if (builtin.zig_backend != .stage1) {
248 if (true) {
265249 // TODO https://github.com/ziglang/zig/issues/9646
266250 return error.SkipZigTest;
267251 }
......@@ -279,8 +263,7 @@ test "shuffle chunks of linker value" {
279263}
280264
281265test "dance on linker values" {
282 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
283 if (builtin.zig_backend != .stage1) {
266 if (true) {
284267 // TODO https://github.com/ziglang/zig/issues/9646
285268 return error.SkipZigTest;
286269 }
......@@ -311,8 +294,7 @@ test "dance on linker values" {
311294}
312295
313296test "offset array ptr by element size" {
314 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
315 if (builtin.zig_backend != .stage1) {
297 if (true) {
316298 // TODO https://github.com/ziglang/zig/issues/9646
317299 return error.SkipZigTest;
318300 }
......@@ -339,8 +321,7 @@ test "offset array ptr by element size" {
339321}
340322
341323test "offset instance by field size" {
342 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
343 if (builtin.zig_backend != .stage1) {
324 if (true) {
344325 // TODO https://github.com/ziglang/zig/issues/9646
345326 return error.SkipZigTest;
346327 }
......@@ -365,8 +346,7 @@ test "offset instance by field size" {
365346}
366347
367348test "offset field ptr by enclosing array element size" {
368 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
369 if (builtin.zig_backend != .stage1) {
349 if (true) {
370350 // TODO https://github.com/ziglang/zig/issues/9646
371351 return error.SkipZigTest;
372352 }
......@@ -395,7 +375,6 @@ test "offset field ptr by enclosing array element size" {
395375}
396376
397377test "accessing reinterpreted memory of parent object" {
398 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
399378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
400379 const S = extern struct {
401380 a: f32,
test/behavior/error.zig-15
......@@ -151,7 +151,6 @@ test "fn returning empty error set can be passed as fn returning any error" {
151151}
152152
153153test "fn returning empty error set can be passed as fn returning any error - pointer" {
154 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
155154 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
156155 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
157156
......@@ -465,11 +464,6 @@ test "nested catch" {
465464}
466465
467466test "function pointer with return type that is error union with payload which is pointer of parent struct" {
468 if (builtin.zig_backend == .stage1) {
469 // stage1 has wrong function pointer semantics
470 return error.SkipZigTest;
471 }
472
473467 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
474468 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
475469
......@@ -582,9 +576,6 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 {
582576}
583577
584578test "error set equality" {
585 // This tests using stage2 logic (#11022)
586 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
587
588579 const a = error{One};
589580 const b = error{One};
590581
......@@ -752,7 +743,6 @@ const NoReturn = struct {
752743};
753744
754745test "error union of noreturn used with if" {
755 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
756746 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
757747 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
758748 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
......@@ -767,7 +757,6 @@ test "error union of noreturn used with if" {
767757}
768758
769759test "error union of noreturn used with try" {
770 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
771760 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
772761 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
773762 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
......@@ -779,7 +768,6 @@ test "error union of noreturn used with try" {
779768}
780769
781770test "error union of noreturn used with catch" {
782 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
783771 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
784772 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
785773 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
......@@ -807,7 +795,6 @@ test "alignment of wrapping an error union payload" {
807795}
808796
809797test "compare error union and error set" {
810 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
811798 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
812799
813800 var a: anyerror = error.Foo;
......@@ -857,8 +844,6 @@ test "error from comptime string" {
857844}
858845
859846test "field access of anyerror results in smaller error set" {
860 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
861
862847 const E1 = @TypeOf(error.Foo);
863848 try expect(@TypeOf(E1.Foo) == E1);
864849 const E2 = error{ A, B, C };
test/behavior/eval.zig+9-21
......@@ -606,15 +606,16 @@ fn assertEqualPtrs(ptr1: *const u8, ptr2: *const u8) !void {
606606
607607// This one is still up for debate in the language specification.
608608// Application code should not rely on this behavior until it is solidified.
609// Currently, stage1 has special case code to make this pass for string literals
610// but it does not work if the values are constructed with comptime code, or if
609// Historically, stage1 had special case code to make this pass for string literals
610// but it did not work if the values are constructed with comptime code, or if
611611// arrays of non-u8 elements are used instead.
612612// The official language specification might not make this guarantee. However, if
613613// it does make this guarantee, it will make it consistently for all types, not
614// only string literals. This is why stage2 currently has a string table for
615// string literals, to match stage1 and pass this test, however the end-game once
616// the lang spec issue is settled would be to use a global InternPool for comptime
617// memoized objects, making this behavior consistent across all types.
614// only string literals. This is why Zig currently has a string table for
615// string literals, to match legacy stage1 behavior and pass this test, however
616// the end-game once the lang spec issue is settled would be to use a global
617// InternPool for comptime memoized objects, making this behavior consistent
618// across all types.
618619test "string literal used as comptime slice is memoized" {
619620 const a = "link";
620621 const b = "link";
......@@ -742,7 +743,6 @@ fn scalar(x: u32) u32 {
742743}
743744
744745test "array concatenation peer resolves element types - value" {
745 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
746746 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
747747 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
748748
......@@ -758,7 +758,6 @@ test "array concatenation peer resolves element types - value" {
758758}
759759
760760test "array concatenation peer resolves element types - pointer" {
761 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
762761 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
763762 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
764763
......@@ -774,7 +773,6 @@ test "array concatenation peer resolves element types - pointer" {
774773}
775774
776775test "array concatenation sets the sentinel - value" {
777 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
778776 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
779777 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
780778 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -794,7 +792,6 @@ test "array concatenation sets the sentinel - value" {
794792}
795793
796794test "array concatenation sets the sentinel - pointer" {
797 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
798795 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
799796
800797 var a = [2]u3{ 1, 7 };
......@@ -811,7 +808,6 @@ test "array concatenation sets the sentinel - pointer" {
811808}
812809
813810test "array multiplication sets the sentinel - value" {
814 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
815811 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
816812 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
817813 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -829,7 +825,6 @@ test "array multiplication sets the sentinel - value" {
829825}
830826
831827test "array multiplication sets the sentinel - pointer" {
832 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
833828 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
834829 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
835830
......@@ -894,8 +889,6 @@ test "const type-annotated local initialized with function call has correct type
894889}
895890
896891test "comptime pointer load through elem_ptr" {
897 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 fails this test
898
899892 const S = struct {
900893 x: usize,
901894 };
......@@ -1038,7 +1031,6 @@ test "comptime break operand passing through runtime condition converted to runt
10381031}
10391032
10401033test "comptime break operand passing through runtime switch converted to runtime break" {
1041 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10421034 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
10431035
10441036 const S = struct {
......@@ -1294,8 +1286,6 @@ test "repeated value is correctly expanded" {
12941286}
12951287
12961288test "value in if block is comptime-known" {
1297 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1298
12991289 const first = blk: {
13001290 const s = if (false) "a" else "b";
13011291 break :blk "foo" ++ s;
......@@ -1330,8 +1320,6 @@ test "lazy value is resolved as slice operand" {
13301320}
13311321
13321322test "break from inline loop depends on runtime condition" {
1333 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1334
13351323 const S = struct {
13361324 fn foo(a: u8) bool {
13371325 return a == 4;
......@@ -1405,7 +1393,7 @@ test "length of global array is determinable at comptime" {
14051393
14061394test "continue nested inline for loop" {
14071395 // TODO: https://github.com/ziglang/zig/issues/13175
1408 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
1396 if (true) return error.SkipZigTest;
14091397
14101398 var a: u8 = 0;
14111399 loop: inline for ([_]u8{ 1, 2 }) |x| {
......@@ -1422,7 +1410,7 @@ test "continue nested inline for loop" {
14221410
14231411test "continue nested inline for loop in named block expr" {
14241412 // TODO: https://github.com/ziglang/zig/issues/13175
1425 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
1413 if (true) return error.SkipZigTest;
14261414
14271415 var a: u8 = 0;
14281416 loop: inline for ([_]u8{ 1, 2 }) |x| {
test/behavior/floatop.zig+1-15
......@@ -114,7 +114,7 @@ fn testSqrt() !void {
114114 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 1.1)), 1.0488088481701516, epsilon));
115115 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 2.0)), 1.4142135623730950, epsilon));
116116
117 if (builtin.zig_backend == .stage1) {
117 if (false) {
118118 if (has_f80_rt) {
119119 // TODO https://github.com/ziglang/zig/issues/10875
120120 if (builtin.os.tag != .freebsd) {
......@@ -181,10 +181,6 @@ test "more @sqrt f16 tests" {
181181}
182182
183183test "@sin" {
184 if (builtin.zig_backend == .stage1) {
185 // stage1 emits an incorrect compile error for `@as(ty, std.math.pi / 2)`
186 return error.SkipZigTest;
187 }
188184 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
189185 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
190186 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -205,7 +201,6 @@ fn testSin() !void {
205201}
206202
207203test "@sin with vectors" {
208 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
209204 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
210205 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
211206 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -226,10 +221,6 @@ fn testSinWithVectors() !void {
226221}
227222
228223test "@cos" {
229 if (builtin.zig_backend == .stage1) {
230 // stage1 emits an incorrect compile error for `@as(ty, std.math.pi / 2)`
231 return error.SkipZigTest;
232 }
233224 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
234225 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
235226 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -250,7 +241,6 @@ fn testCos() !void {
250241}
251242
252243test "@cos with vectors" {
253 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
254244 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
255245 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
256246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -781,7 +771,6 @@ test "f128 at compile time is lossy" {
781771}
782772
783773test "comptime fixed-width float zero divided by zero produces NaN" {
784 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
785774 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
786775 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
787776 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -793,7 +782,6 @@ test "comptime fixed-width float zero divided by zero produces NaN" {
793782}
794783
795784test "comptime fixed-width float non-zero divided by zero produces signed Inf" {
796 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
797785 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
798786 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
799787 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -810,8 +798,6 @@ test "comptime fixed-width float non-zero divided by zero produces signed Inf" {
810798}
811799
812800test "comptime_float zero divided by zero produces zero" {
813 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
814
815801 try expect((0.0 / 0.0) == 0.0);
816802}
817803
test/behavior/fn.zig-10
......@@ -68,8 +68,6 @@ fn outer(y: u32) *const fn (u32) u32 {
6868}
6969
7070test "return inner function which references comptime variable of outer function" {
71 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
72
7371 var func = outer(10);
7472 try expect(func(3) == 7);
7573}
......@@ -97,7 +95,6 @@ test "discard the result of a function that returns a struct" {
9795}
9896
9997test "inline function call that calls optional function pointer, return pointer at callsite interacts correctly with callsite return type" {
100 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10198 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
10299 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
103100 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
......@@ -145,7 +142,6 @@ fn fnWithUnreachable() noreturn {
145142}
146143
147144test "extern struct with stdcallcc fn pointer" {
148 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
149145 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
150146 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
151147
......@@ -293,11 +289,6 @@ fn acceptsString(foo: []u8) void {
293289}
294290
295291test "function pointers" {
296 if (builtin.zig_backend == .stage1) {
297 // stage1 has wrong semantics for function pointers
298 return error.SkipZigTest;
299 }
300
301292 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
302293 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
303294 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -415,7 +406,6 @@ test "import passed byref to function in return type" {
415406}
416407
417408test "implicit cast function to function ptr" {
418 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
419409 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
420410 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
421411 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
test/behavior/generics.zig+2-4
......@@ -21,8 +21,8 @@ test "simple generic fn" {
2121
2222 try expect(max(i32, 3, -1) == 3);
2323 try expect(max(u8, 1, 100) == 100);
24 if (builtin.zig_backend == .stage1) {
25 // TODO: stage2 is incorrectly emitting the following:
24 if (false) {
25 // TODO: zig is incorrectly emitting the following:
2626 // error: cast of value 1.23e-01 to type 'f32' loses information
2727 try expect(max(f32, 0.123, 0.456) == 0.456);
2828 }
......@@ -342,8 +342,6 @@ test "generic instantiation of tagged union with only one field" {
342342}
343343
344344test "nested generic function" {
345 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
346
347345 const S = struct {
348346 fn foo(comptime T: type, callback: *const fn (user_data: T) anyerror!void, data: T) anyerror!void {
349347 try callback(data);
test/behavior/int128.zig+2-2
......@@ -29,8 +29,8 @@ test "undefined 128 bit int" {
2929
3030 @setRuntimeSafety(true);
3131
32 // TODO implement @setRuntimeSafety in stage2
33 if (builtin.zig_backend != .stage1 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {
32 // TODO implement @setRuntimeSafety
33 if (builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {
3434 return error.SkipZigTest;
3535 }
3636
test/behavior/inttoptr.zig-2
......@@ -1,8 +1,6 @@
11const builtin = @import("builtin");
22
33test "casting integer address to function pointer" {
4 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
5
64 addressToFunction();
75 comptime addressToFunction();
86}
test/behavior/math.zig+4-13
......@@ -94,7 +94,6 @@ fn testOneClz(comptime T: type, x: T) u32 {
9494}
9595
9696test "@clz vectors" {
97 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
9897 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
9998 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
10099 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -156,7 +155,6 @@ fn testOneCtz(comptime T: type, x: T) u32 {
156155}
157156
158157test "@ctz vectors" {
159 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
160158 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
161159 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
162160 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -971,8 +969,6 @@ test "overflow arithmetic with u0 values" {
971969}
972970
973971test "allow signed integer division/remainder when values are comptime-known and positive or exact" {
974 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
975
976972 try expect(5 / 3 == 1);
977973 try expect(-5 / -3 == 1);
978974 try expect(-6 / 3 == -2);
......@@ -1009,14 +1005,8 @@ test "quad hex float literal parsing accurate" {
10091005 try expect(@bitCast(u128, f) == 0x40042eab345678439abcdefea5678234);
10101006 }
10111007 {
1012 // TODO: modify stage1/parse_f128.c to use round-to-even
1013 if (builtin.zig_backend == .stage1) {
1014 var f: f128 = 0x1.edcb34a235253948765432134674fp-1;
1015 try expect(@bitCast(u128, f) == 0x3ffeedcb34a235253948765432134674); // round-down
1016 } else {
1017 var f: f128 = 0x1.edcb34a235253948765432134674fp-1;
1018 try expect(@bitCast(u128, f) == 0x3ffeedcb34a235253948765432134675); // round-to-even
1019 }
1008 var f: f128 = 0x1.edcb34a235253948765432134674fp-1;
1009 try expect(@bitCast(u128, f) == 0x3ffeedcb34a235253948765432134675); // round-to-even
10201010 }
10211011 {
10221012 var f: f128 = 0x1.353e45674d89abacc3a2ebf3ff4ffp-50;
......@@ -1270,7 +1260,8 @@ test "@sqrt" {
12701260 try testSqrt(f16, 13.0);
12711261 comptime try testSqrt(f16, 13.0);
12721262
1273 if (builtin.zig_backend == .stage1) {
1263 // TODO: make this pass
1264 if (false) {
12741265 const x = 14.0;
12751266 const y = x * x;
12761267 const z = @sqrt(y);
test/behavior/member_func.zig-2
......@@ -27,7 +27,6 @@ const HasFuncs = struct {
2727};
2828
2929test "standard field calls" {
30 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3130 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3231 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
3332 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
......@@ -71,7 +70,6 @@ test "standard field calls" {
7170}
7271
7372test "@field field calls" {
74 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
7573 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
7674 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
7775 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
test/behavior/muladd.zig-6
......@@ -47,7 +47,6 @@ test "@mulAdd f80" {
4747 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
4848 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
4949 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
50 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
5150 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .windows) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/12602
5251
5352 comptime try testMulAdd80();
......@@ -91,7 +90,6 @@ fn vector16() !void {
9190}
9291
9392test "vector f16" {
94 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
9593 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
9694 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
9795 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -115,7 +113,6 @@ fn vector32() !void {
115113}
116114
117115test "vector f32" {
118 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
119116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
120117 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
121118 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -139,7 +136,6 @@ fn vector64() !void {
139136}
140137
141138test "vector f64" {
142 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
143139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
144140 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
145141 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -162,7 +158,6 @@ fn vector80() !void {
162158}
163159
164160test "vector f80" {
165 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
166161 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
167162 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
168163 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -187,7 +182,6 @@ fn vector128() !void {
187182}
188183
189184test "vector f128" {
190 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
191185 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
192186 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
193187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/optional.zig-5
......@@ -377,8 +377,6 @@ const NoReturn = struct {
377377};
378378
379379test "optional of noreturn used with if" {
380 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
381
382380 NoReturn.a = 64;
383381 if (NoReturn.loop()) |_| {
384382 @compileError("bad");
......@@ -388,8 +386,6 @@ test "optional of noreturn used with if" {
388386}
389387
390388test "optional of noreturn used with orelse" {
391 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
392
393389 NoReturn.a = 64;
394390 const val = NoReturn.testOrelse();
395391 try expect(val == 123);
......@@ -419,7 +415,6 @@ test "alignment of wrapping an optional payload" {
419415}
420416
421417test "Optional slice size is optimized" {
422 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
423418 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
424419 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
425420 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/packed-struct.zig-38
......@@ -5,38 +5,7 @@ const expect = std.testing.expect;
55const expectEqual = std.testing.expectEqual;
66const native_endian = builtin.cpu.arch.endian();
77
8test "correct size of packed structs" {
9 // Stage2 has different packed struct semantics.
10 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
11 const T1 = packed struct { one: u8, three: [3]u8 };
12
13 try expectEqual(4, @sizeOf(T1));
14 try expectEqual(4 * 8, @bitSizeOf(T1));
15
16 const T2 = packed struct { three: [3]u8, one: u8 };
17
18 try expectEqual(4, @sizeOf(T2));
19 try expectEqual(4 * 8, @bitSizeOf(T2));
20
21 const T3 = packed struct { _1: u1, x: u7, _: u24 };
22
23 try expectEqual(4, @sizeOf(T3));
24 try expectEqual(4 * 8, @bitSizeOf(T3));
25
26 const T4 = packed struct { _1: u1, x: u7, _2: u8, _3: u16 };
27
28 try expectEqual(4, @sizeOf(T4));
29 try expectEqual(4 * 8, @bitSizeOf(T4));
30
31 const T5 = packed struct { _1: u1, x: u7, _2: u16, _3: u8 };
32
33 try expectEqual(4, @sizeOf(T5));
34 try expectEqual(4 * 8, @bitSizeOf(T5));
35}
36
378test "flags in packed structs" {
38 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
39
409 const Flags1 = packed struct {
4110 // first 8 bits
4211 b0_0: u1,
......@@ -121,8 +90,6 @@ test "flags in packed structs" {
12190}
12291
12392test "consistent size of packed structs" {
124 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
125
12693 const TxData1 = packed struct { data: u8, _23: u23, full: bool = false };
12794 const TxData2 = packed struct { data: u9, _22: u22, full: bool = false };
12895
......@@ -149,7 +116,6 @@ test "consistent size of packed structs" {
149116}
150117
151118test "correct sizeOf and offsets in packed structs" {
152 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
153119 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
154120 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
155121 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -218,7 +184,6 @@ test "correct sizeOf and offsets in packed structs" {
218184}
219185
220186test "nested packed structs" {
221 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
222187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
223188 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
224189 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -285,7 +250,6 @@ test "regular in irregular packed struct" {
285250}
286251
287252test "byte-aligned field pointer offsets" {
288 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
289253 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
290254 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
291255 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -387,7 +351,6 @@ test "byte-aligned field pointer offsets" {
387351}
388352
389353test "load pointer from packed struct" {
390 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
391354 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
392355 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
393356 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
......@@ -571,7 +534,6 @@ test "runtime init of unnamed packed struct type" {
571534}
572535
573536test "packed struct passed to callconv(.C) function" {
574 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
575537 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
576538 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
577539 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/packed_struct_explicit_backing_int.zig-1
......@@ -5,7 +5,6 @@ const expectEqual = std.testing.expectEqual;
55const native_endian = builtin.cpu.arch.endian();
66
77test "packed struct explicit backing integer" {
8 assert(builtin.zig_backend != .stage1);
98 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
109 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1110 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
test/behavior/pointers.zig-3
......@@ -135,9 +135,6 @@ test "peer type resolution with C pointers" {
135135}
136136
137137test "peer type resolution with C pointer and const pointer" {
138 // stage1 incorrectly resolves to [*]u8
139 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
140
141138 var ptr_c: [*c]u8 = undefined;
142139 const ptr_const: u8 = undefined;
143140 try expect(@TypeOf(ptr_c, &ptr_const) == [*c]const u8);
test/behavior/popcount.zig-1
......@@ -65,7 +65,6 @@ fn testPopCountIntegers() !void {
6565}
6666
6767test "@popCount vectors" {
68 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
6968 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
7069 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
7170 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/ptrcast.zig-7
......@@ -20,7 +20,6 @@ fn testReinterpretBytesAsInteger() !void {
2020}
2121
2222test "reinterpret an array over multiple elements, with no well-defined layout" {
23 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
2423 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
2524 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2625 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -77,8 +76,6 @@ fn testReinterpretBytesAsExternStruct() !void {
7776}
7877
7978test "reinterpret bytes of an extern struct (with under-aligned fields) into another" {
80 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
81
8279 try testReinterpretExternStructAsExternStruct();
8380 comptime try testReinterpretExternStructAsExternStruct();
8481}
......@@ -101,8 +98,6 @@ fn testReinterpretExternStructAsExternStruct() !void {
10198}
10299
103100test "reinterpret bytes of an extern struct into another" {
104 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
105
106101 try testReinterpretOverAlignedExternStructAsExternStruct();
107102 comptime try testReinterpretOverAlignedExternStructAsExternStruct();
108103}
......@@ -127,7 +122,6 @@ fn testReinterpretOverAlignedExternStructAsExternStruct() !void {
127122}
128123
129124test "lower reinterpreted comptime field ptr (with under-aligned fields)" {
130 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
131125 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
132126 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
133127 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -151,7 +145,6 @@ test "lower reinterpreted comptime field ptr (with under-aligned fields)" {
151145}
152146
153147test "lower reinterpreted comptime field ptr" {
154 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
155148 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
156149 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
157150 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig-4
......@@ -149,10 +149,6 @@ test "saturating multiplication" {
149149 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
150150 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
151151
152 if (builtin.zig_backend == .stage1 and builtin.cpu.arch == .wasm32) {
153 // https://github.com/ziglang/zig/issues/9660
154 return error.SkipZigTest;
155 }
156152 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {
157153 // https://github.com/ziglang/zig/issues/9660
158154 return error.SkipZigTest;
test/behavior/select.zig-1
......@@ -32,7 +32,6 @@ fn selectVectors() !void {
3232}
3333
3434test "@select arrays" {
35 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
3635 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
3736 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
3837 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/shuffle.zig+1-1
......@@ -71,7 +71,7 @@ test "@shuffle bool 2" {
7171 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
7272 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
7373
74 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {
74 if (builtin.zig_backend == .stage2_llvm) {
7575 // https://github.com/ziglang/zig/issues/3246
7676 return error.SkipZigTest;
7777 }
test/behavior/sizeof_and_typeof.zig-53
......@@ -101,52 +101,6 @@ test "@offsetOf" {
101101 try expect(@ptrToInt(&a.i) - @ptrToInt(&a) == @offsetOf(A, "i"));
102102}
103103
104test "@offsetOf packed struct, array length not power of 2 or multiple of native pointer width in bytes" {
105 // Stage2 has different packed struct semantics.
106 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
107 const p3a_len = 3;
108 const P3 = packed struct {
109 a: [p3a_len]u8,
110 b: usize,
111 };
112 try std.testing.expect(0 == @offsetOf(P3, "a"));
113 try std.testing.expect(p3a_len == @offsetOf(P3, "b"));
114
115 const p5a_len = 5;
116 const P5 = packed struct {
117 a: [p5a_len]u8,
118 b: usize,
119 };
120 try std.testing.expect(0 == @offsetOf(P5, "a"));
121 try std.testing.expect(p5a_len == @offsetOf(P5, "b"));
122
123 const p6a_len = 6;
124 const P6 = packed struct {
125 a: [p6a_len]u8,
126 b: usize,
127 };
128 try std.testing.expect(0 == @offsetOf(P6, "a"));
129 try std.testing.expect(p6a_len == @offsetOf(P6, "b"));
130
131 const p7a_len = 7;
132 const P7 = packed struct {
133 a: [p7a_len]u8,
134 b: usize,
135 };
136 try std.testing.expect(0 == @offsetOf(P7, "a"));
137 try std.testing.expect(p7a_len == @offsetOf(P7, "b"));
138
139 const p9a_len = 9;
140 const P9 = packed struct {
141 a: [p9a_len]u8,
142 b: usize,
143 };
144 try std.testing.expect(0 == @offsetOf(P9, "a"));
145 try std.testing.expect(p9a_len == @offsetOf(P9, "b"));
146
147 // 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25 etc. are further cases
148}
149
150104test "@bitOffsetOf" {
151105 // Packed structs have fixed memory layout
152106 try expect(@bitOffsetOf(P, "a") == 0);
......@@ -211,8 +165,6 @@ test "branching logic inside @TypeOf" {
211165}
212166
213167test "@bitSizeOf" {
214 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
215
216168 try expect(@bitSizeOf(u2) == 2);
217169 try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8);
218170 try expect(@bitSizeOf(struct {
......@@ -224,11 +176,6 @@ test "@bitSizeOf" {
224176}
225177
226178test "@sizeOf comparison against zero" {
227 if (builtin.zig_backend == .stage1) {
228 // stage1 gets the wrong answer for size of pointers to zero bit types
229 return error.SkipZigTest;
230 }
231
232179 const S0 = struct {
233180 f: *@This(),
234181 };
test/behavior/slice.zig+4-28
......@@ -182,7 +182,6 @@ test "slicing zero length array" {
182182const x = @intToPtr([*]i32, 0x1000)[0..0x500];
183183const y = x[0x100..];
184184test "compile time slice of pointer to hard coded address" {
185 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
186185 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
187186
188187 try expect(@ptrToInt(x) == 0x1000);
......@@ -444,10 +443,7 @@ test "slice syntax resulting in pointer-to-array" {
444443 var array: [2]u8 = [2]u8{ 1, 2 };
445444 var slice: ?[]u8 = &array;
446445 comptime try expect(@TypeOf(&array, slice) == ?[]u8);
447 if (builtin.zig_backend != .stage1) {
448 // stage1 is not passing this case
449 comptime try expect(@TypeOf(slice, &array) == ?[]u8);
450 }
446 comptime try expect(@TypeOf(slice, &array) == ?[]u8);
451447 comptime try expect(@TypeOf(slice.?[0..2]) == *[2]u8);
452448 }
453449
......@@ -479,13 +475,7 @@ test "slice pointer-to-array null terminated" {
479475 var slice: [:0]u8 = &array;
480476 try expect(@TypeOf(slice[1..3]) == *[2]u8);
481477 try expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
482
483 if (builtin.zig_backend == .stage1) {
484 try expect(@TypeOf(slice[1..]) == [:0]u8);
485 } else {
486 // stage2 gives a more accurate, correct answer
487 try expect(@TypeOf(slice[1..]) == *[4:0]u8);
488 }
478 try expect(@TypeOf(slice[1..]) == *[4:0]u8);
489479 }
490480
491481 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
......@@ -509,12 +499,7 @@ test "slice pointer-to-array zero length" {
509499 var array = [0:0]u8{};
510500 var src_slice: [:0]u8 = &array;
511501 var slice = src_slice[0..0];
512 if (builtin.zig_backend == .stage1) {
513 try expect(@TypeOf(slice) == *[0]u8);
514 } else {
515 // stage2 gives a more accurate, correct answer
516 try expect(@TypeOf(slice) == *[0:0]u8);
517 }
502 try expect(@TypeOf(slice) == *[0:0]u8);
518503 }
519504 }
520505
......@@ -573,16 +558,11 @@ test "array concat of slices gives ptr to array" {
573558 var b: []const u8 = "asdf";
574559 const c = a ++ b;
575560 try expect(std.mem.eql(u8, c, "aoeuasdf"));
576 if (builtin.zig_backend != .stage1) {
577 // spec change: array concat now returns pointer-to-array for slices
578 try expect(@TypeOf(c) == *const [8]u8);
579 }
561 try expect(@TypeOf(c) == *const [8]u8);
580562 }
581563}
582564
583565test "array mult of slice gives ptr to array" {
584 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // Stage 1 does not support multiplying slices
585
586566 comptime {
587567 var a: []const u8 = "aoeu";
588568 const c = a ** 2;
......@@ -626,8 +606,6 @@ test "slice sentinel access at comptime" {
626606}
627607
628608test "slicing array with sentinel as end index" {
629 // Doesn't work in stage1
630 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
631609 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
632610
633611 const S = struct {
......@@ -645,8 +623,6 @@ test "slicing array with sentinel as end index" {
645623}
646624
647625test "slicing slice with sentinel as end index" {
648 // Doesn't work in stage1
649 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
650626 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
651627
652628 const S = struct {
test/behavior/struct.zig+2-40
......@@ -419,11 +419,8 @@ test "packed struct 24bits" {
419419 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
420420
421421 comptime {
422 // stage1 gets the wrong answer for sizeof
423 if (builtin.zig_backend != .stage1) {
424 std.debug.assert(@sizeOf(Foo24Bits) == @sizeOf(u24));
425 std.debug.assert(@sizeOf(Foo96Bits) == @sizeOf(u96));
426 }
422 std.debug.assert(@sizeOf(Foo24Bits) == @sizeOf(u24));
423 std.debug.assert(@sizeOf(Foo96Bits) == @sizeOf(u96));
427424 }
428425
429426 var value = Foo96Bits{
......@@ -497,10 +494,6 @@ const Bitfields = packed struct {
497494};
498495
499496test "packed struct fields are ordered from LSB to MSB" {
500 if (builtin.zig_backend == .stage1) {
501 // stage1 gets the wrong answer for a lot of targets
502 return error.SkipZigTest;
503 }
504497 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
505498 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
506499 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -640,7 +633,6 @@ test "default struct initialization fields" {
640633}
641634
642635test "packed array 24bits" {
643 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
644636 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
645637 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
646638 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
......@@ -698,25 +690,6 @@ const FooArray24Bits = packed struct {
698690 c: u16,
699691};
700692
701test "aligned array of packed struct" {
702 // Stage2 has different packed struct semantics.
703 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
704 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
705
706 comptime {
707 try expect(@sizeOf(FooStructAligned) == 2);
708 try expect(@sizeOf(FooArrayOfAligned) == 2 * 2);
709 }
710
711 var bytes = [_]u8{0xbb} ** @sizeOf(FooArrayOfAligned);
712 const ptr = &std.mem.bytesAsSlice(FooArrayOfAligned, bytes[0..])[0];
713
714 try expect(ptr.a[0].a == 0xbb);
715 try expect(ptr.a[0].b == 0xbb);
716 try expect(ptr.a[1].a == 0xbb);
717 try expect(ptr.a[1].b == 0xbb);
718}
719
720693const FooStructAligned = packed struct {
721694 a: u8,
722695 b: u8,
......@@ -1150,7 +1123,6 @@ test "for loop over pointers to struct, getting field from struct pointer" {
11501123}
11511124
11521125test "anon init through error unions and optionals" {
1153 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
11541126 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
11551127 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
11561128 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -1178,7 +1150,6 @@ test "anon init through error unions and optionals" {
11781150}
11791151
11801152test "anon init through optional" {
1181 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
11821153 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
11831154 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
11841155 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -1199,7 +1170,6 @@ test "anon init through optional" {
11991170}
12001171
12011172test "anon init through error union" {
1202 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
12031173 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
12041174 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
12051175 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -1220,7 +1190,6 @@ test "anon init through error union" {
12201190}
12211191
12221192test "typed init through error unions and optionals" {
1223 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
12241193 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
12251194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
12261195 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -1283,10 +1252,6 @@ test "loading a struct pointer perfoms a copy" {
12831252}
12841253
12851254test "packed struct aggregate init" {
1286 if (builtin.zig_backend == .stage1) {
1287 // stage1 fails this test on mips
1288 return error.SkipZigTest;
1289 }
12901255 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
12911256 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
12921257 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -1328,8 +1293,6 @@ test "packed struct field access via pointer" {
13281293}
13291294
13301295test "store to comptime field" {
1331 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1332
13331296 {
13341297 const S = struct {
13351298 comptime a: [2]u32 = [2]u32{ 1, 2 },
......@@ -1364,7 +1327,6 @@ test "struct field init value is size of the struct" {
13641327}
13651328
13661329test "under-aligned struct field" {
1367 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
13681330 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
13691331 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
13701332 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
test/behavior/truncate.zig-5
......@@ -60,11 +60,6 @@ test "truncate on comptime integer" {
6060}
6161
6262test "truncate on vectors" {
63 if (builtin.zig_backend == .stage1) {
64 // stage1 fails the comptime test
65 return error.SkipZigTest;
66 }
67
6863 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
6964 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
7065 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/type.zig+2-11
......@@ -229,7 +229,7 @@ test "Type.Vector" {
229229}
230230
231231test "Type.AnyFrame" {
232 if (builtin.zig_backend != .stage1) {
232 if (true) {
233233 // https://github.com/ziglang/zig/issues/6025
234234 return error.SkipZigTest;
235235 }
......@@ -246,8 +246,6 @@ fn add(a: i32, b: i32) i32 {
246246}
247247
248248test "Type.ErrorSet" {
249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
250
251249 try testing.expect(@Type(.{ .ErrorSet = null }) == anyerror);
252250
253251 // error sets don't compare equal so just check if they compile
......@@ -369,12 +367,7 @@ test "Type.Enum" {
369367 try testing.expectEqual(@as(u8, 5), @enumToInt(Foo.b));
370368 const Bar = @Type(.{
371369 .Enum = .{
372 // stage2 only has auto layouts
373 .layout = if (builtin.zig_backend == .stage1)
374 .Extern
375 else
376 .Auto,
377
370 .layout = .Auto,
378371 .tag_type = u32,
379372 .fields = &.{
380373 .{ .name = "a", .value = 1 },
......@@ -501,8 +494,6 @@ test "Type.Union from regular enum" {
501494}
502495
503496test "Type.Fn" {
504 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
505
506497 if (true) {
507498 // https://github.com/ziglang/zig/issues/12360
508499 return error.SkipZigTest;
test/behavior/type_info.zig+17-26
......@@ -201,9 +201,6 @@ test "type info: error set single value" {
201201}
202202
203203test "type info: error set merged" {
204 // #11022 forces ordering of error sets in stage2
205 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
206
207204 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
208205 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
209206 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -305,8 +302,6 @@ const TestStruct = struct {
305302};
306303
307304test "type info: packed struct info" {
308 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
309
310305 try testPackedStruct();
311306 comptime try testPackedStruct();
312307}
......@@ -376,25 +371,21 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.C) usize;
376371extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.C) usize;
377372
378373test "type info: generic function types" {
379 if (builtin.zig_backend != .stage1) {
380 // stage1 marks all args/return types as null if the function
381 // is generic at all. stage2 is more specific.
382 const G1 = @typeInfo(@TypeOf(generic1));
383 try expect(G1.Fn.args.len == 1);
384 try expect(G1.Fn.args[0].is_generic == true);
385 try expect(G1.Fn.args[0].arg_type == null);
386 try expect(G1.Fn.return_type == void);
387
388 const G2 = @typeInfo(@TypeOf(generic2));
389 try expect(G2.Fn.args.len == 3);
390 try expect(G2.Fn.args[0].is_generic == false);
391 try expect(G2.Fn.args[0].arg_type == type);
392 try expect(G2.Fn.args[1].is_generic == true);
393 try expect(G2.Fn.args[1].arg_type == null);
394 try expect(G2.Fn.args[2].is_generic == false);
395 try expect(G2.Fn.args[2].arg_type == u8);
396 try expect(G2.Fn.return_type == void);
397 }
374 const G1 = @typeInfo(@TypeOf(generic1));
375 try expect(G1.Fn.args.len == 1);
376 try expect(G1.Fn.args[0].is_generic == true);
377 try expect(G1.Fn.args[0].arg_type == null);
378 try expect(G1.Fn.return_type == void);
379
380 const G2 = @typeInfo(@TypeOf(generic2));
381 try expect(G2.Fn.args.len == 3);
382 try expect(G2.Fn.args[0].is_generic == false);
383 try expect(G2.Fn.args[0].arg_type == type);
384 try expect(G2.Fn.args[1].is_generic == true);
385 try expect(G2.Fn.args[1].arg_type == null);
386 try expect(G2.Fn.args[2].is_generic == false);
387 try expect(G2.Fn.args[2].arg_type == u8);
388 try expect(G2.Fn.return_type == void);
398389
399390 const G3 = @typeInfo(@TypeOf(generic3));
400391 try expect(G3.Fn.args.len == 1);
......@@ -442,7 +433,7 @@ fn testVector() !void {
442433}
443434
444435test "type info: anyframe and anyframe->T" {
445 if (builtin.zig_backend != .stage1) {
436 if (true) {
446437 // https://github.com/ziglang/zig/issues/6025
447438 return error.SkipZigTest;
448439 }
......@@ -501,7 +492,7 @@ fn add(a: i32, b: i32) i32 {
501492}
502493
503494test "type info for async frames" {
504 if (builtin.zig_backend != .stage1) {
495 if (true) {
505496 // https://github.com/ziglang/zig/issues/6025
506497 return error.SkipZigTest;
507498 }
test/behavior/typename.zig-29
......@@ -12,12 +12,6 @@ const expectStringStartsWith = std.testing.expectStringStartsWith;
1212// failures.
1313
1414test "anon fn param" {
15 if (builtin.zig_backend == .stage1) {
16 // stage1 uses line/column for the names but we're moving away from that for
17 // incremental compilation purposes.
18 return error.SkipZigTest;
19 }
20
2115 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
2216 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2317 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -43,12 +37,6 @@ test "anon fn param" {
4337}
4438
4539test "anon field init" {
46 if (builtin.zig_backend == .stage1) {
47 // stage1 uses line/column for the names but we're moving away from that for
48 // incremental compilation purposes.
49 return error.SkipZigTest;
50 }
51
5240 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
5341 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
5442 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -84,11 +72,6 @@ test "basic" {
8472}
8573
8674test "top level decl" {
87 if (builtin.zig_backend == .stage1) {
88 // stage1 fails to return fully qualified namespaces.
89 return error.SkipZigTest;
90 }
91
9275 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
9376 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
9477 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -208,11 +191,6 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8)
208191}
209192
210193test "local variable" {
211 if (builtin.zig_backend == .stage1) {
212 // stage1 fails to return fully qualified namespaces.
213 return error.SkipZigTest;
214 }
215
216194 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
217195 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
218196 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -231,7 +209,6 @@ test "local variable" {
231209}
232210
233211test "comptime parameters not converted to anytype in function type" {
234 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
235212 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
236213 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
237214 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
......@@ -241,12 +218,6 @@ test "comptime parameters not converted to anytype in function type" {
241218}
242219
243220test "anon name strategy used in sub expression" {
244 if (builtin.zig_backend == .stage1) {
245 // stage1 uses line/column for the names but we're moving away from that for
246 // incremental compilation purposes.
247 return error.SkipZigTest;
248 }
249
250221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
251222 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
252223 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
test/behavior/undefined.zig-4
......@@ -76,10 +76,6 @@ test "assign undefined to struct with method" {
7676}
7777
7878test "type name of undefined" {
79 if (builtin.zig_backend == .stage1) {
80 // stage1 gets the type name wrong
81 return error.SkipZigTest;
82 }
8379 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
8480
8581 const x = undefined;
test/behavior/union.zig-5
......@@ -221,7 +221,6 @@ test "packed union generates correctly aligned type" {
221221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
222222 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
223223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
224 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
225224
226225 const U = packed union {
227226 f1: *const fn () error{TestUnexpectedResult}!void,
......@@ -1002,7 +1001,6 @@ test "cast from pointer to anonymous struct to pointer to union" {
10021001}
10031002
10041003test "switching on non exhaustive union" {
1005 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
10061004 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
10071005 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
10081006
......@@ -1197,7 +1195,6 @@ test "union tag is set when initiated as a temporary value at runtime" {
11971195}
11981196
11991197test "extern union most-aligned field is smaller" {
1200 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
12011198 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
12021199 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12031200 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -1246,7 +1243,6 @@ test "return an extern union from C calling convention" {
12461243}
12471244
12481245test "noreturn field in union" {
1249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
12501246 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
12511247 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12521248 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -1298,7 +1294,6 @@ test "noreturn field in union" {
12981294}
12991295
13001296test "union and enum field order doesn't match" {
1301 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
13021297 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
13031298 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
13041299
test/behavior/vector.zig+2-39
......@@ -6,12 +6,6 @@ const expect = std.testing.expect;
66const expectEqual = std.testing.expectEqual;
77
88test "implicit cast vector to array - bool" {
9 if (builtin.zig_backend == .stage1) {
10 // Regressed in LLVM 14:
11 // https://github.com/llvm/llvm-project/issues/55522
12 return error.SkipZigTest;
13 }
14
159 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1610 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1711 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -180,9 +174,7 @@ test "tuple to vector" {
180174 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
181175 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
182176
183 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and
184 builtin.cpu.arch == .aarch64)
185 {
177 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
186178 // Regressed with LLVM 14:
187179 // https://github.com/ziglang/zig/issues/12012
188180 return error.SkipZigTest;
......@@ -197,9 +189,7 @@ test "tuple to vector" {
197189 }
198190
199191 try std.testing.expectEqual(v, Vec3{ 1, 1, 1 });
200 if (builtin.zig_backend != .stage1) {
201 try std.testing.expectEqual(v, .{ 1, 1, 1 });
202 }
192 try std.testing.expectEqual(v, .{ 1, 1, 1 });
203193 }
204194 };
205195 try S.doTheTest();
......@@ -406,12 +396,6 @@ test "initialize vector which is a struct field" {
406396}
407397
408398test "vector comparison operators" {
409 if (builtin.zig_backend == .stage1) {
410 // Regressed in LLVM 14:
411 // https://github.com/llvm/llvm-project/issues/55522
412 return error.SkipZigTest;
413 }
414
415399 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
416400 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
417401 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
......@@ -801,7 +785,6 @@ test "vector reduce operation" {
801785}
802786
803787test "vector @reduce comptime" {
804 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
805788 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
806789 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
807790 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -937,10 +920,6 @@ test "saturating shift-left" {
937920}
938921
939922test "multiplication-assignment operator with an array operand" {
940 if (builtin.zig_backend == .stage1) {
941 // stage1 emits a compile error
942 return error.SkipZigTest;
943 }
944923 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
945924 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
946925 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -961,10 +940,6 @@ test "multiplication-assignment operator with an array operand" {
961940}
962941
963942test "@addWithOverflow" {
964 if (builtin.zig_backend == .stage1) {
965 // stage1 doesn't support vector args
966 return error.SkipZigTest;
967 }
968943 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
969944 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
970945 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -1011,10 +986,6 @@ test "@addWithOverflow" {
1011986}
1012987
1013988test "@subWithOverflow" {
1014 if (builtin.zig_backend == .stage1) {
1015 // stage1 doesn't support vector args
1016 return error.SkipZigTest;
1017 }
1018989 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1019990 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1020991 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -1045,10 +1016,6 @@ test "@subWithOverflow" {
10451016}
10461017
10471018test "@mulWithOverflow" {
1048 if (builtin.zig_backend == .stage1) {
1049 // stage1 doesn't support vector args
1050 return error.SkipZigTest;
1051 }
10521019 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
10531020 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
10541021 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
......@@ -1069,10 +1036,6 @@ test "@mulWithOverflow" {
10691036}
10701037
10711038test "@shlWithOverflow" {
1072 if (builtin.zig_backend == .stage1) {
1073 // stage1 doesn't support vector args
1074 return error.SkipZigTest;
1075 }
10761039 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
10771040 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
10781041 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/while.zig+7
......@@ -364,3 +364,10 @@ test "try terminating an infinite loop" {
364364 _ = try Foo.bar();
365365 } else unreachable);
366366}
367
368test "while loop with comptime true condition needs no else block to return value with break" {
369 const x = while (true) {
370 break @as(u32, 69);
371 };
372 try expect(x == 69);
373}