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
signaturebadge-question-mark 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 {...@@ -214,8 +214,8 @@ pub fn Atomic(comptime T: type) type {
214 inline fn bitRmw(self: *Self, comptime op: BitRmwOp, bit: Bit, comptime ordering: Ordering) u1 {214 inline fn bitRmw(self: *Self, comptime op: BitRmwOp, bit: Bit, comptime ordering: Ordering) u1 {
215 // x86 supports dedicated bitwise instructions215 // x86 supports dedicated bitwise instructions
216 if (comptime builtin.target.cpu.arch.isX86() and @sizeOf(T) >= 2 and @sizeOf(T) <= 8) {216 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.217 // TODO: this causes std lib test failures when enabled
218 if (builtin.zig_backend == .stage1) {218 if (false) {
219 return x86BitRmw(self, op, bit, ordering);219 return x86BitRmw(self, op, bit, ordering);
220 }220 }
221 }221 }
lib/std/base64.zig+1-1
...@@ -9,7 +9,7 @@ pub const Error = error{...@@ -9,7 +9,7 @@ pub const Error = error{
9 NoSpaceLeft,9 NoSpaceLeft,
10};10};
1111
12const decoderWithIgnoreProto = std.meta.FnPtr(fn (ignore: []const u8) Base64DecoderWithIgnore);12const decoderWithIgnoreProto = *const fn (ignore: []const u8) Base64DecoderWithIgnore;
1313
14/// Base64 codecs14/// Base64 codecs
15pub const Codecs = struct {15pub const Codecs = struct {
lib/std/build.zig+2-3
...@@ -3293,8 +3293,7 @@ pub const LibExeObjStep = struct {...@@ -3293,8 +3293,7 @@ pub const LibExeObjStep = struct {
3293 while (try it.next()) |entry| {3293 while (try it.next()) |entry| {
3294 // The compiler can put these files into the same directory, but we don't3294 // The compiler can put these files into the same directory, but we don't
3295 // want to copy them over.3295 // want to copy them over.
3296 if (mem.eql(u8, entry.name, "stage1.id") or3296 if (mem.eql(u8, entry.name, "llvm-ar.id") or
3297 mem.eql(u8, entry.name, "llvm-ar.id") or
3298 mem.eql(u8, entry.name, "libs.txt") or3297 mem.eql(u8, entry.name, "libs.txt") or
3299 mem.eql(u8, entry.name, "builtin.zig") or3298 mem.eql(u8, entry.name, "builtin.zig") or
3300 mem.eql(u8, entry.name, "zld.id") or3299 mem.eql(u8, entry.name, "zld.id") or
...@@ -3607,7 +3606,7 @@ pub const Step = struct {...@@ -3607,7 +3606,7 @@ pub const Step = struct {
3607 loop_flag: bool,3606 loop_flag: bool,
3608 done_flag: bool,3607 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
3612 pub const Id = enum {3611 pub const Id = enum {
3613 top_level,3612 top_level,
lib/std/build/WriteFileStep.zig+3-3
...@@ -62,9 +62,9 @@ fn make(step: *Step) !void {...@@ -62,9 +62,9 @@ fn make(step: *Step) !void {
62 // If, for example, a hard-coded path was used as the location to put WriteFileStep62 // If, for example, a hard-coded path was used as the location to put WriteFileStep
63 // files, then two WriteFileSteps executing in parallel might clobber each other.63 // 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 blake2b65 // TODO port the cache system from the compiler to zig std lib. Until then
66 // directly and construct the path, and no "cache hit" detection happens; the files66 // we use blake2b directly and construct the path, and no "cache hit"
67 // are always written.67 // detection happens; the files are always written.
68 var hash = std.crypto.hash.blake2.Blake2b384.init(.{});68 var hash = std.crypto.hash.blake2.Blake2b384.init(.{});
6969
70 // Random bytes to make WriteFileStep unique. Refresh this with70 // Random bytes to make WriteFileStep unique. Refresh this with
lib/std/builtin.zig+6-5
...@@ -698,8 +698,9 @@ pub const CompilerBackend = enum(u64) {...@@ -698,8 +698,9 @@ pub const CompilerBackend = enum(u64) {
698 /// in which case this value is appropriate. Be cool and make sure your698 /// in which case this value is appropriate. Be cool and make sure your
699 /// code supports `other` Zig compilers!699 /// code supports `other` Zig compilers!
700 other = 0,700 other = 0,
701 /// The original Zig compiler created in 2015 by Andrew Kelley.701 /// The original Zig compiler created in 2015 by Andrew Kelley. Implemented
702 /// Implemented in C++. Uses LLVM.702 /// in C++. Used LLVM. Deleted from the ZSF ziglang/zig codebase on
703 /// December 6th, 2022.
703 stage1 = 1,704 stage1 = 1,
704 /// The reference implementation self-hosted compiler of Zig, using the705 /// The reference implementation self-hosted compiler of Zig, using the
705 /// LLVM backend.706 /// LLVM backend.
...@@ -738,7 +739,7 @@ pub const CompilerBackend = enum(u64) {...@@ -738,7 +739,7 @@ pub const CompilerBackend = enum(u64) {
738/// therefore must be kept in sync with the compiler implementation.739/// therefore must be kept in sync with the compiler implementation.
739pub const TestFn = struct {740pub const TestFn = struct {
740 name: []const u8,741 name: []const u8,
741 func: std.meta.FnPtr(fn () anyerror!void),742 func: *const fn () anyerror!void,
742 async_frame_size: ?usize,743 async_frame_size: ?usize,
743};744};
744745
...@@ -760,8 +761,8 @@ else...@@ -760,8 +761,8 @@ else
760pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr: ?usize) noreturn {761pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr: ?usize) noreturn {
761 @setCold(true);762 @setCold(true);
762763
763 // Until self-hosted catches up with stage1 language features, we have a simpler764 // For backends that cannot handle the language features depended on by the
764 // default panic function:765 // default panic handler, we have a simpler panic handler:
765 if (builtin.zig_backend == .stage2_c or766 if (builtin.zig_backend == .stage2_c or
766 builtin.zig_backend == .stage2_wasm or767 builtin.zig_backend == .stage2_wasm or
767 builtin.zig_backend == .stage2_arm or768 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;...@@ -241,8 +241,12 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int;
241pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int;241pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int;
242pub extern "c" fn futimens(fd: c.fd_t, times: *const [2]c.timespec) c_int;242pub 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);244pub extern "c" fn pthread_create(
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;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;
246pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E;250pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E;
247pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) c.E;251pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) c.E;
248pub extern "c" fn pthread_attr_setstacksize(attr: *c.pthread_attr_t, stacksize: usize) c.E;252pub 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;...@@ -251,14 +255,15 @@ pub extern "c" fn pthread_attr_destroy(attr: *c.pthread_attr_t) c.E;
251pub extern "c" fn pthread_self() pthread_t;255pub extern "c" fn pthread_self() pthread_t;
252pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) c.E;256pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) c.E;
253pub extern "c" fn pthread_detach(thread: pthread_t) c.E;257pub extern "c" fn pthread_detach(thread: pthread_t) c.E;
254const PThreadForkFn = std.meta.FnPtr(fn () callconv(.C) void);
255pub extern "c" fn pthread_atfork(258pub extern "c" fn pthread_atfork(
256 prepare: ?PThreadForkFn,259 prepare: ?*const fn () callconv(.C) void,
257 parent: ?PThreadForkFn,260 parent: ?*const fn () callconv(.C) void,
258 child: ?PThreadForkFn,261 child: ?*const fn () callconv(.C) void,
259) c_int;262) c_int;
260const PThreadKeyCreateFn = std.meta.FnPtr(fn (value: *anyopaque) callconv(.C) void);263pub extern "c" fn pthread_key_create(
261pub extern "c" fn pthread_key_create(key: *c.pthread_key_t, destructor: ?PThreadKeyCreateFn) c.E;264 key: *c.pthread_key_t,
265 destructor: ?*const fn (value: *anyopaque) callconv(.C) void,
266) c.E;
262pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E;267pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E;
263pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*anyopaque;268pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*anyopaque;
264pub extern "c" fn pthread_setspecific(key: c.pthread_key_t, value: ?*anyopaque) c_int;269pub 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 {...@@ -918,8 +918,8 @@ pub const siginfo_t = extern struct {
918918
919/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.919/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
920pub const Sigaction = extern struct {920pub const Sigaction = extern struct {
921 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);921 pub const handler_fn = *const 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);922 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
923923
924 handler: extern union {924 handler: extern union {
925 handler: ?handler_fn,925 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;...@@ -13,7 +13,7 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
13pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;13pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
14pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int;14pub 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;
17pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;17pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1818
19pub extern "c" fn lwp_gettid() c_int;19pub extern "c" fn lwp_gettid() c_int;
...@@ -681,8 +681,8 @@ pub const empty_sigset = sigset_t{ .__bits = [_]c_uint{0} ** _SIG_WORDS };...@@ -681,8 +681,8 @@ pub const empty_sigset = sigset_t{ .__bits = [_]c_uint{0} ** _SIG_WORDS };
681pub const sig_atomic_t = c_int;681pub const sig_atomic_t = c_int;
682682
683pub const Sigaction = extern struct {683pub const Sigaction = extern struct {
684 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);684 pub const handler_fn = *const 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);685 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
686686
687 /// signal handler687 /// signal handler
688 handler: extern union {688 handler: extern union {
lib/std/c/freebsd.zig+3-3
...@@ -37,7 +37,7 @@ pub extern "c" fn sendfile(...@@ -37,7 +37,7 @@ pub extern "c" fn sendfile(
37 flags: u32,37 flags: u32,
38) c_int;38) 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;
41pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;41pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
4242
43pub const pthread_mutex_t = extern struct {43pub const pthread_mutex_t = extern struct {
...@@ -1197,8 +1197,8 @@ const NSIG = 32;...@@ -1197,8 +1197,8 @@ const NSIG = 32;
11971197
1198/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.1198/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
1199pub const Sigaction = extern struct {1199pub const Sigaction = extern struct {
1200 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);1200 pub const handler_fn = *const 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);1201 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
12021202
1203 /// signal handler1203 /// signal handler
1204 handler: extern union {1204 handler: extern union {
lib/std/c/haiku.zig+1-1
...@@ -742,7 +742,7 @@ const NSIG = 32;...@@ -742,7 +742,7 @@ const NSIG = 32;
742742
743/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.743/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
744pub const Sigaction = extern struct {744pub 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
747 /// signal handler747 /// signal handler
748 __sigaction_u: extern union {748 __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;...@@ -263,7 +263,7 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int;
263/// See std.elf for constants for this263/// See std.elf for constants for this
264pub extern "c" fn getauxval(__type: c_ulong) c_ulong;264pub 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
268pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;268pub 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;...@@ -9,7 +9,7 @@ const rusage = std.c.rusage;
9extern "c" fn __errno() *c_int;9extern "c" fn __errno() *c_int;
10pub const _errno = __errno;10pub 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;
13pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;13pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1414
15pub extern "c" fn _lwp_self() lwpid_t;15pub extern "c" fn _lwp_self() lwpid_t;
...@@ -971,8 +971,8 @@ pub const SIG = struct {...@@ -971,8 +971,8 @@ pub const SIG = struct {
971971
972/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.972/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
973pub const Sigaction = extern struct {973pub const Sigaction = extern struct {
974 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);974 pub const handler_fn = *const 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);975 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
976976
977 /// signal handler977 /// signal handler
978 handler: extern union {978 handler: extern union {
lib/std/c/openbsd.zig+3-3
...@@ -7,7 +7,7 @@ const iovec_const = std.os.iovec_const;...@@ -7,7 +7,7 @@ const iovec_const = std.os.iovec_const;
7extern "c" fn __errno() *c_int;7extern "c" fn __errno() *c_int;
8pub const _errno = __errno;8pub 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;
11pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;11pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1212
13pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;13pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
...@@ -1026,8 +1026,8 @@ pub const SIG = struct {...@@ -1026,8 +1026,8 @@ pub const SIG = struct {
10261026
1027/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.1027/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
1028pub const Sigaction = extern struct {1028pub const Sigaction = extern struct {
1029 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);1029 pub const handler_fn = *const 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);1030 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
10311031
1032 /// signal handler1032 /// signal handler
1033 handler: extern union {1033 handler: extern union {
lib/std/c/solaris.zig+3-3
...@@ -8,7 +8,7 @@ const timezone = std.c.timezone;...@@ -8,7 +8,7 @@ const timezone = std.c.timezone;
8extern "c" fn ___errno() *c_int;8extern "c" fn ___errno() *c_int;
9pub const _errno = ___errno;9pub 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;
12pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;12pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;
1313
14pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;14pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
...@@ -952,8 +952,8 @@ pub const SIG = struct {...@@ -952,8 +952,8 @@ pub const SIG = struct {
952952
953/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.953/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
954pub const Sigaction = extern struct {954pub const Sigaction = extern struct {
955 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);955 pub const handler_fn = *const 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);956 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
957957
958 /// signal options958 /// signal options
959 flags: c_uint,959 flags: c_uint,
lib/std/compress/deflate/compressor.zig+1-1
...@@ -254,7 +254,7 @@ pub fn Compressor(comptime WriterType: anytype) type {...@@ -254,7 +254,7 @@ pub fn Compressor(comptime WriterType: anytype) type {
254254
255 // Inner writer wrapped in a HuffmanBitWriter255 // Inner writer wrapped in a HuffmanBitWriter
256 hm_bw: hm_bw.HuffmanBitWriter(WriterType) = undefined,256 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
259 sync: bool, // requesting flush259 sync: bool, // requesting flush
260 best_speed_enc: *fast.DeflateFast, // Encoder for best_speed260 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...@@ -133,7 +133,8 @@ fn testToFromWithLevelAndLimit(level: deflate.Compression, input: []const u8, li
133 try expect(read == input.len);133 try expect(read == input.len);
134 try expect(mem.eql(u8, input, decompressed));134 try expect(mem.eql(u8, input, decompressed));
135135
136 if (builtin.zig_backend == .stage1) {136 if (false) {
137 // TODO: this test has regressed
137 try testSync(level, input);138 try testSync(level, input);
138 }139 }
139}140}
lib/std/compress/deflate/decompressor.zig+1-7
...@@ -334,7 +334,7 @@ pub fn Decompressor(comptime ReaderType: type) type {...@@ -334,7 +334,7 @@ pub fn Decompressor(comptime ReaderType: type) type {
334334
335 // Next step in the decompression,335 // Next step in the decompression,
336 // and decompression state.336 // and decompression state.
337 step: std.meta.FnPtr(fn (*Self) Error!void),337 step: *const fn (*Self) Error!void,
338 step_state: DecompressorState,338 step_state: DecompressorState,
339 final: bool,339 final: bool,
340 err: ?Error,340 err: ?Error,
...@@ -479,12 +479,6 @@ pub fn Decompressor(comptime ReaderType: type) type {...@@ -479,12 +479,6 @@ pub fn Decompressor(comptime ReaderType: type) type {
479 }479 }
480480
481 pub fn close(self: *Self) ?Error {481 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 }
488 if (self.err == @as(?Error, error.EndOfStreamWithNoError)) {482 if (self.err == @as(?Error, error.EndOfStreamWithNoError)) {
489 return null;483 return null;
490 }484 }
lib/std/dwarf.zig+1-1
...@@ -638,7 +638,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en...@@ -638,7 +638,7 @@ fn parseFormValue(allocator: mem.Allocator, in_stream: anytype, form_id: u64, en
638 FORM.line_strp => FormValue{ .LineStrPtr = try readAddress(in_stream, endian, is_64) },638 FORM.line_strp => FormValue{ .LineStrPtr = try readAddress(in_stream, endian, is_64) },
639 FORM.indirect => {639 FORM.indirect => {
640 const child_form_id = try nosuspend leb.readULEB128(u64, in_stream);640 const child_form_id = try nosuspend leb.readULEB128(u64, in_stream);
641 if (builtin.zig_backend != .stage1) {641 if (true) {
642 return parseFormValue(allocator, in_stream, child_form_id, endian, is_64);642 return parseFormValue(allocator, in_stream, child_form_id, endian, is_64);
643 }643 }
644 const F = @TypeOf(async parseFormValue(allocator, in_stream, child_form_id, endian, is_64));644 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(...@@ -109,7 +109,7 @@ pub fn Batch(
109}109}
110110
111test "std.event.Batch" {111test "std.event.Batch" {
112 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest;112 if (true) return error.SkipZigTest;
113 var count: usize = 0;113 var count: usize = 0;
114 var batch = Batch(void, 2, .auto_async).init();114 var batch = Batch(void, 2, .auto_async).init();
115 batch.add(&async sleepALittle(&count));115 batch.add(&async sleepALittle(&count));
lib/std/event/loop.zig+1-1
...@@ -1469,7 +1469,7 @@ pub const Loop = struct {...@@ -1469,7 +1469,7 @@ pub const Loop = struct {
1469 .Cancelled => continue,1469 .Cancelled => continue,
1470 }1470 }
1471 if (overlapped) |o| break o;1471 if (overlapped) |o| break o;
1472 } else unreachable; // TODO else unreachable should not be necessary1472 };
1473 const resume_node = @fieldParentPtr(ResumeNode, "overlapped", overlapped);1473 const resume_node = @fieldParentPtr(ResumeNode, "overlapped", overlapped);
1474 const handle = resume_node.handle;1474 const handle = resume_node.handle;
1475 const resume_node_id = resume_node.id;1475 const resume_node_id = resume_node.id;
lib/std/fmt.zig+1-39
...@@ -2209,7 +2209,7 @@ test "pointer" {...@@ -2209,7 +2209,7 @@ test "pointer" {
2209 try expectFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value});2209 try expectFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value});
2210 try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value});2210 try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value});
2211 }2211 }
2212 const FnPtr = if (builtin.zig_backend == .stage1) fn () void else *align(1) const fn () void;2212 const FnPtr = *align(1) const fn () void;
2213 {2213 {
2214 const value = @intToPtr(FnPtr, 0xdeadbeef);2214 const value = @intToPtr(FnPtr, 0xdeadbeef);
2215 try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value});2215 try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value});
...@@ -2266,10 +2266,6 @@ test "struct" {...@@ -2266,10 +2266,6 @@ test "struct" {
2266}2266}
22672267
2268test "enum" {2268test "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 }
2273 const Enum = enum {2269 const Enum = enum {
2274 One,2270 One,
2275 Two,2271 Two,
...@@ -2285,10 +2281,6 @@ test "enum" {...@@ -2285,10 +2281,6 @@ test "enum" {
2285}2281}
22862282
2287test "non-exhaustive enum" {2283test "non-exhaustive enum" {
2288 if (builtin.zig_backend == .stage1) {
2289 // stage1 fails to return fully qualified namespaces.
2290 return error.SkipZigTest;
2291 }
2292 const Enum = enum(u16) {2284 const Enum = enum(u16) {
2293 One = 0x000f,2285 One = 0x000f,
2294 Two = 0xbeef,2286 Two = 0xbeef,
...@@ -2462,10 +2454,6 @@ test "custom" {...@@ -2462,10 +2454,6 @@ test "custom" {
2462}2454}
24632455
2464test "struct" {2456test "struct" {
2465 if (builtin.zig_backend == .stage1) {
2466 // stage1 fails to return fully qualified namespaces.
2467 return error.SkipZigTest;
2468 }
2469 const S = struct {2457 const S = struct {
2470 a: u32,2458 a: u32,
2471 b: anyerror,2459 b: anyerror,
...@@ -2484,10 +2472,6 @@ test "struct" {...@@ -2484,10 +2472,6 @@ test "struct" {
2484}2472}
24852473
2486test "union" {2474test "union" {
2487 if (builtin.zig_backend == .stage1) {
2488 // stage1 fails to return fully qualified namespaces.
2489 return error.SkipZigTest;
2490 }
2491 const TU = union(enum) {2475 const TU = union(enum) {
2492 float: f32,2476 float: f32,
2493 int: u32,2477 int: u32,
...@@ -2518,10 +2502,6 @@ test "union" {...@@ -2518,10 +2502,6 @@ test "union" {
2518}2502}
25192503
2520test "enum" {2504test "enum" {
2521 if (builtin.zig_backend == .stage1) {
2522 // stage1 fails to return fully qualified namespaces.
2523 return error.SkipZigTest;
2524 }
2525 const E = enum {2505 const E = enum {
2526 One,2506 One,
2527 Two,2507 Two,
...@@ -2534,10 +2514,6 @@ test "enum" {...@@ -2534,10 +2514,6 @@ test "enum" {
2534}2514}
25352515
2536test "struct.self-referential" {2516test "struct.self-referential" {
2537 if (builtin.zig_backend == .stage1) {
2538 // stage1 fails to return fully qualified namespaces.
2539 return error.SkipZigTest;
2540 }
2541 const S = struct {2517 const S = struct {
2542 const SelfType = @This();2518 const SelfType = @This();
2543 a: ?*SelfType,2519 a: ?*SelfType,
...@@ -2552,10 +2528,6 @@ test "struct.self-referential" {...@@ -2552,10 +2528,6 @@ test "struct.self-referential" {
2552}2528}
25532529
2554test "struct.zero-size" {2530test "struct.zero-size" {
2555 if (builtin.zig_backend == .stage1) {
2556 // stage1 fails to return fully qualified namespaces.
2557 return error.SkipZigTest;
2558 }
2559 const A = struct {2531 const A = struct {
2560 fn foo() void {}2532 fn foo() void {}
2561 };2533 };
...@@ -2633,10 +2605,6 @@ test "formatFloatValue with comptime_float" {...@@ -2633,10 +2605,6 @@ test "formatFloatValue with comptime_float" {
2633}2605}
26342606
2635test "formatType max_depth" {2607test "formatType max_depth" {
2636 if (builtin.zig_backend == .stage1) {
2637 // stage1 fails to return fully qualified namespaces.
2638 return error.SkipZigTest;
2639 }
2640 const Vec2 = struct {2608 const Vec2 = struct {
2641 const SelfType = @This();2609 const SelfType = @This();
2642 x: f32,2610 x: f32,
...@@ -2724,12 +2692,6 @@ test "vector" {...@@ -2724,12 +2692,6 @@ test "vector" {
2724 return error.SkipZigTest;2692 return error.SkipZigTest;
2725 }2693 }
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
2733 const vbool: @Vector(4, bool) = [_]bool{ true, false, true, false };2695 const vbool: @Vector(4, bool) = [_]bool{ true, false, true, false };
2734 const vi64: @Vector(4, i64) = [_]i64{ -2, -1, 0, 1 };2696 const vi64: @Vector(4, i64) = [_]i64{ -2, -1, 0, 1 };
2735 const vu64: @Vector(4, u64) = [_]u64{ 1000, 2000, 3000, 4000 };2697 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" {...@@ -70,9 +70,7 @@ test "fmt.parseFloat" {
70}70}
7171
72test "fmt.parseFloat nan and inf" {72test "fmt.parseFloat nan and inf" {
73 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and73 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
74 builtin.cpu.arch == .aarch64)
75 {
76 // https://github.com/ziglang/zig/issues/1202774 // https://github.com/ziglang/zig/issues/12027
77 return error.SkipZigTest;75 return error.SkipZigTest;
78 }76 }
lib/std/json.zig+1-4
...@@ -2373,10 +2373,7 @@ pub fn stringifyAlloc(allocator: std.mem.Allocator, value: anytype, options: Str...@@ -2373,10 +2373,7 @@ pub fn stringifyAlloc(allocator: std.mem.Allocator, value: anytype, options: Str
2373}2373}
23742374
2375test {2375test {
2376 if (builtin.zig_backend != .stage1) {2376 _ = @import("json/test.zig");
2377 // https://github.com/ziglang/zig/issues/8442
2378 _ = @import("json/test.zig");
2379 }
2380 _ = @import("json/write_stream.zig");2377 _ = @import("json/write_stream.zig");
2381}2378}
23822379
lib/std/leb128.zig+2-6
...@@ -347,9 +347,7 @@ fn test_write_leb128(value: anytype) !void {...@@ -347,9 +347,7 @@ fn test_write_leb128(value: anytype) !void {
347}347}
348348
349test "serialize unsigned LEB128" {349test "serialize unsigned LEB128" {
350 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and350 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .riscv64) {
351 builtin.cpu.arch == .riscv64)
352 {
353 // https://github.com/ziglang/zig/issues/12031351 // https://github.com/ziglang/zig/issues/12031
354 return error.SkipZigTest;352 return error.SkipZigTest;
355 }353 }
...@@ -368,9 +366,7 @@ test "serialize unsigned LEB128" {...@@ -368,9 +366,7 @@ test "serialize unsigned LEB128" {
368}366}
369367
370test "serialize signed LEB128" {368test "serialize signed LEB128" {
371 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and369 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .riscv64) {
372 builtin.cpu.arch == .riscv64)
373 {
374 // https://github.com/ziglang/zig/issues/12031370 // https://github.com/ziglang/zig/issues/12031
375 return error.SkipZigTest;371 return error.SkipZigTest;
376 }372 }
lib/std/math.zig+5-13
...@@ -528,9 +528,7 @@ pub fn shl(comptime T: type, a: T, shift_amt: anytype) T {...@@ -528,9 +528,7 @@ pub fn shl(comptime T: type, a: T, shift_amt: anytype) T {
528}528}
529529
530test "shl" {530test "shl" {
531 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and531 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
532 builtin.cpu.arch == .aarch64)
533 {
534 // https://github.com/ziglang/zig/issues/12012532 // https://github.com/ziglang/zig/issues/12012
535 return error.SkipZigTest;533 return error.SkipZigTest;
536 }534 }
...@@ -574,9 +572,7 @@ pub fn shr(comptime T: type, a: T, shift_amt: anytype) T {...@@ -574,9 +572,7 @@ pub fn shr(comptime T: type, a: T, shift_amt: anytype) T {
574}572}
575573
576test "shr" {574test "shr" {
577 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and575 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
578 builtin.cpu.arch == .aarch64)
579 {
580 // https://github.com/ziglang/zig/issues/12012576 // https://github.com/ziglang/zig/issues/12012
581 return error.SkipZigTest;577 return error.SkipZigTest;
582 }578 }
...@@ -621,9 +617,7 @@ pub fn rotr(comptime T: type, x: T, r: anytype) T {...@@ -621,9 +617,7 @@ pub fn rotr(comptime T: type, x: T, r: anytype) T {
621}617}
622618
623test "rotr" {619test "rotr" {
624 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and620 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
625 builtin.cpu.arch == .aarch64)
626 {
627 // https://github.com/ziglang/zig/issues/12012621 // https://github.com/ziglang/zig/issues/12012
628 return error.SkipZigTest;622 return error.SkipZigTest;
629 }623 }
...@@ -667,9 +661,7 @@ pub fn rotl(comptime T: type, x: T, r: anytype) T {...@@ -667,9 +661,7 @@ pub fn rotl(comptime T: type, x: T, r: anytype) T {
667}661}
668662
669test "rotl" {663test "rotl" {
670 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and664 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
671 builtin.cpu.arch == .aarch64)
672 {
673 // https://github.com/ziglang/zig/issues/12012665 // https://github.com/ziglang/zig/issues/12012
674 return error.SkipZigTest;666 return error.SkipZigTest;
675 }667 }
...@@ -1695,7 +1687,7 @@ fn testSign() !void {...@@ -1695,7 +1687,7 @@ fn testSign() !void {
1695}1687}
16961688
1697test "sign" {1689test "sign" {
1698 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {1690 if (builtin.zig_backend == .stage2_llvm) {
1699 // https://github.com/ziglang/zig/issues/120121691 // https://github.com/ziglang/zig/issues/12012
1700 return error.SkipZigTest;1692 return error.SkipZigTest;
1701 }1693 }
lib/std/mem.zig+1-7
...@@ -322,7 +322,7 @@ pub fn zeroes(comptime T: type) T {...@@ -322,7 +322,7 @@ pub fn zeroes(comptime T: type) T {
322}322}
323323
324test "zeroes" {324test "zeroes" {
325 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {325 if (builtin.zig_backend == .stage2_llvm) {
326 // Regressed in LLVM 14:326 // Regressed in LLVM 14:
327 // https://github.com/llvm/llvm-project/issues/55522327 // https://github.com/llvm/llvm-project/issues/55522
328 return error.SkipZigTest;328 return error.SkipZigTest;
...@@ -3187,8 +3187,6 @@ pub fn asBytes(ptr: anytype) AsBytesReturnType(@TypeOf(ptr)) {...@@ -3187,8 +3187,6 @@ pub fn asBytes(ptr: anytype) AsBytesReturnType(@TypeOf(ptr)) {
3187}3187}
31883188
3189test "asBytes" {3189test "asBytes" {
3190 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3191
3192 const deadbeef = @as(u32, 0xDEADBEEF);3190 const deadbeef = @as(u32, 0xDEADBEEF);
3193 const deadbeef_bytes = switch (native_endian) {3191 const deadbeef_bytes = switch (native_endian) {
3194 .Big => "\xDE\xAD\xBE\xEF",3192 .Big => "\xDE\xAD\xBE\xEF",
...@@ -3282,8 +3280,6 @@ pub fn bytesAsValue(comptime T: type, bytes: anytype) BytesAsValueReturnType(T,...@@ -3282,8 +3280,6 @@ pub fn bytesAsValue(comptime T: type, bytes: anytype) BytesAsValueReturnType(T,
3282}3280}
32833281
3284test "bytesAsValue" {3282test "bytesAsValue" {
3285 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3286
3287 const deadbeef = @as(u32, 0xDEADBEEF);3283 const deadbeef = @as(u32, 0xDEADBEEF);
3288 const deadbeef_bytes = switch (native_endian) {3284 const deadbeef_bytes = switch (native_endian) {
3289 .Big => "\xDE\xAD\xBE\xEF",3285 .Big => "\xDE\xAD\xBE\xEF",
...@@ -3485,8 +3481,6 @@ test "sliceAsBytes with sentinel slice" {...@@ -3485,8 +3481,6 @@ test "sliceAsBytes with sentinel slice" {
3485}3481}
34863482
3487test "sliceAsBytes packed struct at runtime and comptime" {3483test "sliceAsBytes packed struct at runtime and comptime" {
3488 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
3489
3490 const Foo = packed struct {3484 const Foo = packed struct {
3491 a: u4,3485 a: u4,
3492 b: u4,3486 b: u4,
lib/std/mem/Allocator.zig+3-3
...@@ -20,7 +20,7 @@ pub const VTable = struct {...@@ -20,7 +20,7 @@ pub const VTable = struct {
20 /// `ret_addr` is optionally provided as the first return address of the20 /// `ret_addr` is optionally provided as the first return address of the
21 /// allocation call stack. If the value is `0` it means no return address21 /// allocation call stack. If the value is `0` it means no return address
22 /// has been provided.22 /// 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
25 /// Attempt to expand or shrink memory in place. `buf.len` must equal the25 /// Attempt to expand or shrink memory in place. `buf.len` must equal the
26 /// length requested from the most recent successful call to `alloc` or26 /// length requested from the most recent successful call to `alloc` or
...@@ -37,7 +37,7 @@ pub const VTable = struct {...@@ -37,7 +37,7 @@ pub const VTable = struct {
37 /// `ret_addr` is optionally provided as the first return address of the37 /// `ret_addr` is optionally provided as the first return address of the
38 /// allocation call stack. If the value is `0` it means no return address38 /// allocation call stack. If the value is `0` it means no return address
39 /// has been provided.39 /// 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
42 /// Free and invalidate a buffer.42 /// Free and invalidate a buffer.
43 ///43 ///
...@@ -50,7 +50,7 @@ pub const VTable = struct {...@@ -50,7 +50,7 @@ pub const VTable = struct {
50 /// `ret_addr` is optionally provided as the first return address of the50 /// `ret_addr` is optionally provided as the first return address of the
51 /// allocation call stack. If the value is `0` it means no return address51 /// allocation call stack. If the value is `0` it means no return address
52 /// has been provided.52 /// 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,
54};54};
5555
56pub fn noResize(56pub fn noResize(
lib/std/meta.zig+2-34
...@@ -361,11 +361,7 @@ pub fn assumeSentinel(p: anytype, comptime sentinel_val: Elem(@TypeOf(p))) Senti...@@ -361,11 +361,7 @@ pub fn assumeSentinel(p: anytype, comptime sentinel_val: Elem(@TypeOf(p))) Senti
361 const ReturnType = Sentinel(T, sentinel_val);361 const ReturnType = Sentinel(T, sentinel_val);
362 switch (@typeInfo(T)) {362 switch (@typeInfo(T)) {
363 .Pointer => |info| switch (info.size) {363 .Pointer => |info| switch (info.size) {
364 .Slice => if (@import("builtin").zig_backend == .stage1)364 .Slice, .Many, .One => return @ptrCast(ReturnType, p),
365 return @bitCast(ReturnType, p)
366 else
367 return @ptrCast(ReturnType, p),
368 .Many, .One => return @ptrCast(ReturnType, p),
369 .C => {},365 .C => {},
370 },366 },
371 .Optional => |info| switch (@typeInfo(info.child)) {367 .Optional => |info| switch (@typeInfo(info.child)) {
...@@ -658,8 +654,6 @@ pub fn FieldEnum(comptime T: type) type {...@@ -658,8 +654,6 @@ pub fn FieldEnum(comptime T: type) type {
658 const field_infos = fields(T);654 const field_infos = fields(T);
659655
660 if (field_infos.len == 0) {656 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");
663 return @Type(.{657 return @Type(.{
664 .Enum = .{658 .Enum = .{
665 .layout = .Auto,659 .layout = .Auto,
...@@ -742,9 +736,7 @@ fn expectEqualEnum(expected: anytype, actual: @TypeOf(expected)) !void {...@@ -742,9 +736,7 @@ fn expectEqualEnum(expected: anytype, actual: @TypeOf(expected)) !void {
742}736}
743737
744test "std.meta.FieldEnum" {738test "std.meta.FieldEnum" {
745 if (comptime @import("builtin").zig_backend != .stage1) {739 try expectEqualEnum(enum {}, FieldEnum(struct {}));
746 try expectEqualEnum(enum {}, FieldEnum(struct {}));
747 }
748 try expectEqualEnum(enum { a }, FieldEnum(struct { a: u8 }));740 try expectEqualEnum(enum { a }, FieldEnum(struct { a: u8 }));
749 try expectEqualEnum(enum { a, b, c }, FieldEnum(struct { a: u8, b: void, c: f32 }));741 try expectEqualEnum(enum { a, b, c }, FieldEnum(struct { a: u8, b: void, c: f32 }));
750 try expectEqualEnum(enum { a, b, c }, FieldEnum(union { a: u8, b: void, c: f32 }));742 try expectEqualEnum(enum { a, b, c }, FieldEnum(union { a: u8, b: void, c: f32 }));
...@@ -1239,27 +1231,3 @@ test "isError" {...@@ -1239,27 +1231,3 @@ test "isError" {
1239 try std.testing.expect(isError(math.absInt(@as(i8, -128))));1231 try std.testing.expect(isError(math.absInt(@as(i8, -128))));
1240 try std.testing.expect(!isError(math.absInt(@as(i8, -127))));1232 try std.testing.expect(!isError(math.absInt(@as(i8, -127))));
1241}1233}
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 {...@@ -90,13 +90,12 @@ pub fn MultiArrayList(comptime S: type) type {
90 };90 };
91 }91 }
92 const Sort = struct {92 const Sort = struct {
93 fn lessThan(trash: *i32, lhs: Data, rhs: Data) bool {93 fn lessThan(context: void, lhs: Data, rhs: Data) bool {
94 _ = trash;94 _ = context;
95 return lhs.alignment > rhs.alignment;95 return lhs.alignment > rhs.alignment;
96 }96 }
97 };97 };
98 var trash: i32 = undefined; // workaround for stage1 compiler bug98 std.sort.sort(Data, &data, {}, Sort.lessThan);
99 std.sort.sort(Data, &data, &trash, Sort.lessThan);
100 var sizes_bytes: [fields.len]usize = undefined;99 var sizes_bytes: [fields.len]usize = undefined;
101 var field_indexes: [fields.len]usize = undefined;100 var field_indexes: [fields.len]usize = undefined;
102 for (data) |elem, i| {101 for (data) |elem, i| {
lib/std/os.zig+2-2
...@@ -3621,7 +3621,7 @@ pub fn accept(...@@ -3621,7 +3621,7 @@ pub fn accept(
3621 else => |err| return unexpectedErrno(err),3621 else => |err| return unexpectedErrno(err),
3622 }3622 }
3623 }3623 }
3624 } else unreachable;3624 };
36253625
3626 if (!have_accept4) {3626 if (!have_accept4) {
3627 try setSockFlags(accepted_sock, flags);3627 try setSockFlags(accepted_sock, flags);
...@@ -5360,7 +5360,7 @@ pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 {...@@ -5360,7 +5360,7 @@ pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 {
5360/// if this happens the fix is to add the error code to the corresponding5360/// if this happens the fix is to add the error code to the corresponding
5361/// switch expression, possibly introduce a new error in the error set, and5361/// switch expression, possibly introduce a new error in the error set, and
5362/// send a patch to Zig.5362/// 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
5365pub const UnexpectedError = error{5365pub const UnexpectedError = error{
5366 /// The Operating System returned an undocumented error code.5366 /// 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 {...@@ -936,16 +936,10 @@ pub fn flock(fd: fd_t, operation: i32) usize {
936 return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation)));936 return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation)));
937}937}
938938
939var vdso_clock_gettime = if (builtin.zig_backend == .stage1)939var vdso_clock_gettime = @ptrCast(?*const anyopaque, &init_vdso_clock_gettime);
940 @ptrCast(?*const anyopaque, init_vdso_clock_gettime)
941else
942 @ptrCast(?*const anyopaque, &init_vdso_clock_gettime);
943940
944// We must follow the C calling convention when we call into the VDSO941// We must follow the C calling convention when we call into the VDSO
945const vdso_clock_gettime_ty = if (builtin.zig_backend == .stage1)942const vdso_clock_gettime_ty = *align(1) const fn (i32, *timespec) callconv(.C) usize;
946 fn (i32, *timespec) callconv(.C) usize
947else
948 *align(1) const fn (i32, *timespec) callconv(.C) usize;
949943
950pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {944pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {
951 if (@hasDecl(VDSO, "CGT_SYM")) {945 if (@hasDecl(VDSO, "CGT_SYM")) {
...@@ -1151,8 +1145,8 @@ pub fn sigaction(sig: u6, noalias act: ?*const Sigaction, noalias oact: ?*Sigact...@@ -1151,8 +1145,8 @@ pub fn sigaction(sig: u6, noalias act: ?*const Sigaction, noalias oact: ?*Sigact
1151 const mask_size = @sizeOf(@TypeOf(ksa.mask));1145 const mask_size = @sizeOf(@TypeOf(ksa.mask));
11521146
1153 if (act) |new| {1147 if (act) |new| {
1154 const restore_rt_ptr = if (builtin.zig_backend == .stage1) restore_rt else &restore_rt;1148 const restore_rt_ptr = &restore_rt;
1155 const restore_ptr = if (builtin.zig_backend == .stage1) restore else &restore;1149 const restore_ptr = &restore;
1156 const restorer_fn = if ((new.flags & SA.SIGINFO) != 0) restore_rt_ptr else restore_ptr;1150 const restorer_fn = if ((new.flags & SA.SIGINFO) != 0) restore_rt_ptr else restore_ptr;
1157 ksa = k_sigaction{1151 ksa = k_sigaction{
1158 .handler = new.handler.handler,1152 .handler = new.handler.handler,
...@@ -3145,8 +3139,8 @@ pub const all_mask: sigset_t = [_]u32{0xffffffff} ** @typeInfo(sigset_t).Array.l...@@ -3145,8 +3139,8 @@ pub const all_mask: sigset_t = [_]u32{0xffffffff} ** @typeInfo(sigset_t).Array.l
3145pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30;3139pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30;
31463140
3147const k_sigaction_funcs = struct {3141const k_sigaction_funcs = struct {
3148 const handler = ?std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);3142 const handler = ?*const fn (c_int) align(1) callconv(.C) void;
3149 const restorer = std.meta.FnPtr(fn () callconv(.C) void);3143 const restorer = *const fn () callconv(.C) void;
3150};3144};
31513145
3152pub const k_sigaction = switch (native_arch) {3146pub const k_sigaction = switch (native_arch) {
...@@ -3172,8 +3166,8 @@ pub const k_sigaction = switch (native_arch) {...@@ -3172,8 +3166,8 @@ pub const k_sigaction = switch (native_arch) {
31723166
3173/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.3167/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
3174pub const Sigaction = extern struct {3168pub const Sigaction = extern struct {
3175 pub const handler_fn = std.meta.FnPtr(fn (c_int) align(1) callconv(.C) void);3169 pub const handler_fn = *const 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);3170 pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void;
31773171
3178 handler: extern union {3172 handler: extern union {
3179 handler: ?handler_fn,3173 handler: ?handler_fn,
...@@ -3181,7 +3175,7 @@ pub const Sigaction = extern struct {...@@ -3181,7 +3175,7 @@ pub const Sigaction = extern struct {
3181 },3175 },
3182 mask: sigset_t,3176 mask: sigset_t,
3183 flags: c_uint,3177 flags: c_uint,
3184 restorer: ?std.meta.FnPtr(fn () callconv(.C) void) = null,3178 restorer: ?*const fn () callconv(.C) void = null,
3185};3179};
31863180
3187pub const empty_sigset = [_]u32{0} ** @typeInfo(sigset_t).Array.len;3181pub const empty_sigset = [_]u32{0} ** @typeInfo(sigset_t).Array.len;
...@@ -3314,25 +3308,12 @@ pub const epoll_data = extern union {...@@ -3314,25 +3308,12 @@ pub const epoll_data = extern union {
3314 u64: u64,3308 u64: u64,
3315};3309};
33163310
3317pub const epoll_event = switch (builtin.zig_backend) {3311pub const epoll_event = extern struct {
3318 // stage1 crashes with the align(4) field so we have this workaround3312 events: u32,
3319 .stage1 => switch (native_arch) {3313 data: epoll_data align(switch (native_arch) {
3320 .x86_64 => packed struct {3314 .x86_64 => 4,
3321 events: u32,3315 else => @alignOf(epoll_data),
3322 data: epoll_data,3316 }),
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 },
3336};3317};
33373318
3338pub const VFS_CAP_REVISION_MASK = 0xFF000000;3319pub const VFS_CAP_REVISION_MASK = 0xFF000000;
lib/std/os/linux/arm-eabi.zig+1-1
...@@ -98,7 +98,7 @@ pub fn syscall6(...@@ -98,7 +98,7 @@ pub fn syscall6(
98 );98 );
99}99}
100100
101const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);101const CloneFn = *const fn (arg: usize) callconv(.C) u8;
102102
103/// This matches the libc clone function.103/// This matches the libc clone function.
104pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;104pub 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(...@@ -98,7 +98,7 @@ pub fn syscall6(
98 );98 );
99}99}
100100
101const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);101const CloneFn = *const fn (arg: usize) callconv(.C) u8;
102102
103/// This matches the libc clone function.103/// This matches the libc clone function.
104pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;104pub 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(...@@ -190,7 +190,7 @@ pub fn syscall7(
190 );190 );
191}191}
192192
193const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);193const CloneFn = *const fn (arg: usize) callconv(.C) u8;
194194
195/// This matches the libc clone function.195/// This matches the libc clone function.
196pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;196pub 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(...@@ -126,7 +126,7 @@ pub fn syscall6(
126 );126 );
127}127}
128128
129const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);129const CloneFn = *const fn (arg: usize) callconv(.C) u8;
130130
131/// This matches the libc clone function.131/// This matches the libc clone function.
132pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;132pub 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(...@@ -126,7 +126,7 @@ pub fn syscall6(
126 );126 );
127}127}
128128
129const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);129const CloneFn = *const fn (arg: usize) callconv(.C) u8;
130130
131/// This matches the libc clone function.131/// This matches the libc clone function.
132pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;132pub 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(...@@ -95,7 +95,7 @@ pub fn syscall6(
95 );95 );
96}96}
9797
98const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);98const CloneFn = *const fn (arg: usize) callconv(.C) u8;
9999
100pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;100pub 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(...@@ -178,7 +178,7 @@ pub fn syscall6(
178 );178 );
179}179}
180180
181const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);181const CloneFn = *const fn (arg: usize) callconv(.C) u8;
182182
183/// This matches the libc clone function.183/// This matches the libc clone function.
184pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;184pub 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 {...@@ -118,7 +118,7 @@ pub fn socketcall(call: usize, args: [*]usize) usize {
118 );118 );
119}119}
120120
121const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);121const CloneFn = *const fn (arg: usize) callconv(.C) u8;
122122
123/// This matches the libc clone function.123/// This matches the libc clone function.
124pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;124pub 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(...@@ -100,7 +100,7 @@ pub fn syscall6(
100 );100 );
101}101}
102102
103const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8);103const CloneFn = *const fn (arg: usize) callconv(.C) u8;
104104
105/// This matches the libc clone function.105/// This matches the libc clone function.
106pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;106pub 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" {...@@ -785,10 +785,8 @@ test "sigaction" {
785 }785 }
786 };786 };
787787
788 const actual_handler = if (builtin.zig_backend == .stage1) S.handler else &S.handler;
789
790 var sa = os.Sigaction{788 var sa = os.Sigaction{
791 .handler = .{ .sigaction = actual_handler },789 .handler = .{ .sigaction = &S.handler },
792 .mask = os.empty_sigset,790 .mask = os.empty_sigset,
793 .flags = os.SA.SIGINFO | os.SA.RESETHAND,791 .flags = os.SA.SIGINFO | os.SA.RESETHAND,
794 };792 };
...@@ -799,7 +797,7 @@ test "sigaction" {...@@ -799,7 +797,7 @@ test "sigaction" {
799797
800 // Check that we can read it back correctly.798 // Check that we can read it back correctly.
801 try os.sigaction(os.SIG.USR1, null, &old_sa);799 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.?);
803 try testing.expect((old_sa.flags & os.SA.SIGINFO) != 0);801 try testing.expect((old_sa.flags & os.SA.SIGINFO) != 0);
804802
805 // Invoke the handler.803 // Invoke the handler.
lib/std/os/uefi/protocols/absolute_pointer_protocol.zig+2-2
...@@ -6,8 +6,8 @@ const Status = uefi.Status;...@@ -6,8 +6,8 @@ const Status = uefi.Status;
66
7/// Protocol for touchscreens7/// Protocol for touchscreens
8pub const AbsolutePointerProtocol = extern struct {8pub const AbsolutePointerProtocol = extern struct {
9 _reset: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status),9 _reset: *const fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status,
10 _get_state: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status),10 _get_state: *const fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status,
11 wait_for_input: Event,11 wait_for_input: Event,
12 mode: *AbsolutePointerMode,12 mode: *AbsolutePointerMode,
1313
lib/std/os/uefi/protocols/block_io_protocol.zig+4-4
...@@ -44,10 +44,10 @@ pub const BlockIoProtocol = extern struct {...@@ -44,10 +44,10 @@ pub const BlockIoProtocol = extern struct {
44 revision: u64,44 revision: u64,
45 media: *EfiBlockMedia,45 media: *EfiBlockMedia,
4646
47 _reset: std.meta.FnPtr(fn (*BlockIoProtocol, extended_verification: bool) callconv(.C) Status),47 _reset: *const 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),48 _read_blocks: *const 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),49 _write_blocks: *const 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),50 _flush_blocks: *const fn (*BlockIoProtocol) callconv(.C) Status,
5151
52 /// Resets the block device hardware.52 /// Resets the block device hardware.
53 pub fn reset(self: *Self, extended_verification: bool) Status {53 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;...@@ -6,7 +6,7 @@ const Status = uefi.Status;
66
7/// Override EDID information7/// Override EDID information
8pub const EdidOverrideProtocol = extern struct {8pub 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
11 /// Returns policy information and potentially a replacement EDID for the specified video output device.11 /// Returns policy information and potentially a replacement EDID for the specified video output device.
12 pub fn getEdid(12 pub fn getEdid(
lib/std/os/uefi/protocols/file_protocol.zig+10-10
...@@ -7,16 +7,16 @@ const Status = uefi.Status;...@@ -7,16 +7,16 @@ const Status = uefi.Status;
77
8pub const FileProtocol = extern struct {8pub const FileProtocol = extern struct {
9 revision: u64,9 revision: u64,
10 _open: std.meta.FnPtr(fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status),10 _open: *const fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status,
11 _close: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),11 _close: *const fn (*const FileProtocol) callconv(.C) Status,
12 _delete: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),12 _delete: *const fn (*const FileProtocol) callconv(.C) Status,
13 _read: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status),13 _read: *const fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status,
14 _write: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status),14 _write: *const fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status,
15 _get_position: std.meta.FnPtr(fn (*const FileProtocol, *u64) callconv(.C) Status),15 _get_position: *const fn (*const FileProtocol, *u64) callconv(.C) Status,
16 _set_position: std.meta.FnPtr(fn (*const FileProtocol, u64) callconv(.C) Status),16 _set_position: *const 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),17 _get_info: *const 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),18 _set_info: *const fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status,
19 _flush: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status),19 _flush: *const fn (*const FileProtocol) callconv(.C) Status,
2020
21 pub const SeekError = error{SeekError};21 pub const SeekError = error{SeekError};
22 pub const GetSeekPosError = error{GetSeekPosError};22 pub const GetSeekPosError = error{GetSeekPosError};
lib/std/os/uefi/protocols/graphics_output_protocol.zig+3-3
...@@ -5,9 +5,9 @@ const Status = uefi.Status;...@@ -5,9 +5,9 @@ const Status = uefi.Status;
55
6/// Graphics output6/// Graphics output
7pub const GraphicsOutputProtocol = extern struct {7pub const GraphicsOutputProtocol = extern struct {
8 _query_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status),8 _query_mode: *const fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status,
9 _set_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status),9 _set_mode: *const 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),10 _blt: *const fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status,
11 mode: *GraphicsOutputProtocolMode,11 mode: *GraphicsOutputProtocolMode,
1212
13 /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports.13 /// 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;...@@ -7,10 +7,10 @@ const hii = uefi.protocols.hii;
7/// Database manager for HII-related data structures.7/// Database manager for HII-related data structures.
8pub const HIIDatabaseProtocol = extern struct {8pub const HIIDatabaseProtocol = extern struct {
9 _new_package_list: Status, // TODO9 _new_package_list: Status, // TODO
10 _remove_package_list: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status),10 _remove_package_list: *const 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),11 _update_package_list: *const 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),12 _list_package_lists: *const 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),13 _export_package_lists: *const fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status,
14 _register_package_notify: Status, // TODO14 _register_package_notify: Status, // TODO
15 _unregister_package_notify: Status, // TODO15 _unregister_package_notify: Status, // TODO
16 _find_keyboard_layouts: Status, // TODO16 _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;...@@ -7,7 +7,7 @@ const hii = uefi.protocols.hii;
7/// Display a popup window7/// Display a popup window
8pub const HIIPopupProtocol = extern struct {8pub const HIIPopupProtocol = extern struct {
9 revision: u64,9 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
12 /// Displays a popup window.12 /// Displays a popup window.
13 pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) Status {13 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;...@@ -5,10 +5,10 @@ const Event = uefi.Event;
5const Status = uefi.Status;5const Status = uefi.Status;
66
7pub const Ip6ConfigProtocol = extern struct {7pub const Ip6ConfigProtocol = extern struct {
8 _set_data: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status),8 _set_data: *const 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),9 _get_data: *const 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),10 _register_data_notify: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
11 _unregister_data_notify: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status),11 _unregister_data_notify: *const fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
1212
13 pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const anyopaque) Status {13 pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const anyopaque) Status {
14 return self._set_data(self, data_type, data_size, data);14 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;...@@ -8,15 +8,15 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
8const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;8const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
99
10pub const Ip6Protocol = extern struct {10pub const Ip6Protocol = extern struct {
11 _get_mode_data: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),11 _get_mode_data: *const fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
12 _configure: std.meta.FnPtr(fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status),12 _configure: *const fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status,
13 _groups: std.meta.FnPtr(fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status),13 _groups: *const 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),14 _routes: *const 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),15 _neighbors: *const 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),16 _transmit: *const fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
17 _receive: std.meta.FnPtr(fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status),17 _receive: *const fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
18 _cancel: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status),18 _cancel: *const fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status,
19 _poll: std.meta.FnPtr(fn (*const Ip6Protocol) callconv(.C) Status),19 _poll: *const fn (*const Ip6Protocol) callconv(.C) Status,
2020
21 /// Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.21 /// Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.
22 pub fn getModeData(self: *const Ip6Protocol, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {22 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;...@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
5const Status = uefi.Status;5const Status = uefi.Status;
66
7pub const Ip6ServiceBindingProtocol = extern struct {7pub const Ip6ServiceBindingProtocol = extern struct {
8 _create_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: std.meta.FnPtr(fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status),9 _destroy_child: *const fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status,
1010
11 pub fn createChild(self: *const Ip6ServiceBindingProtocol, handle: *?Handle) Status {11 pub fn createChild(self: *const Ip6ServiceBindingProtocol, handle: *?Handle) Status {
12 return self._create_child(self, handle);12 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 {...@@ -20,7 +20,7 @@ pub const LoadedImageProtocol = extern struct {
20 image_size: u64,20 image_size: u64,
21 image_code_type: MemoryType,21 image_code_type: MemoryType,
22 image_data_type: MemoryType,22 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
25 /// Unloads an image from memory.25 /// Unloads an image from memory.
26 pub fn unload(self: *const LoadedImageProtocol, handle: Handle) Status {26 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;...@@ -8,14 +8,14 @@ const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
8const MacAddress = uefi.protocols.MacAddress;8const MacAddress = uefi.protocols.MacAddress;
99
10pub const ManagedNetworkProtocol = extern struct {10pub const ManagedNetworkProtocol = extern struct {
11 _get_mode_data: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),11 _get_mode_data: *const fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
12 _configure: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status),12 _configure: *const 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),13 _mcast_ip_to_mac: *const fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status,
14 _groups: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status),14 _groups: *const fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
15 _transmit: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),15 _transmit: *const fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
16 _receive: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),16 _receive: *const fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
17 _cancel: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status),17 _cancel: *const fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status,
18 _poll: std.meta.FnPtr(fn (*const ManagedNetworkProtocol) callconv(.C) Status),18 _poll: *const fn (*const ManagedNetworkProtocol) callconv(.C) Status,
1919
20 /// Returns the operational parameters for the current MNP child driver.20 /// Returns the operational parameters for the current MNP child driver.
21 /// May also support returning the underlying SNP driver mode data.21 /// 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;...@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
5const Status = uefi.Status;5const Status = uefi.Status;
66
7pub const ManagedNetworkServiceBindingProtocol = extern struct {7pub const ManagedNetworkServiceBindingProtocol = extern struct {
8 _create_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: std.meta.FnPtr(fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status),9 _destroy_child: *const fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status,
1010
11 pub fn createChild(self: *const ManagedNetworkServiceBindingProtocol, handle: *?Handle) Status {11 pub fn createChild(self: *const ManagedNetworkServiceBindingProtocol, handle: *?Handle) Status {
12 return self._create_child(self, handle);12 return self._create_child(self, handle);
lib/std/os/uefi/protocols/rng_protocol.zig+2-2
...@@ -5,8 +5,8 @@ const Status = uefi.Status;...@@ -5,8 +5,8 @@ const Status = uefi.Status;
55
6/// Random Number Generator protocol6/// Random Number Generator protocol
7pub const RNGProtocol = extern struct {7pub const RNGProtocol = extern struct {
8 _get_info: std.meta.FnPtr(fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status),8 _get_info: *const 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),9 _get_rng: *const fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status,
1010
11 /// Returns information about the random number generation implementation.11 /// Returns information about the random number generation implementation.
12 pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) Status {12 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;...@@ -6,7 +6,7 @@ const Status = uefi.Status;
66
7pub const SimpleFileSystemProtocol = extern struct {7pub const SimpleFileSystemProtocol = extern struct {
8 revision: u64,8 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
11 pub fn openVolume(self: *const SimpleFileSystemProtocol, root: **const FileProtocol) Status {11 pub fn openVolume(self: *const SimpleFileSystemProtocol, root: **const FileProtocol) Status {
12 return self._open_volume(self, root);12 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;...@@ -6,19 +6,19 @@ const Status = uefi.Status;
66
7pub const SimpleNetworkProtocol = extern struct {7pub const SimpleNetworkProtocol = extern struct {
8 revision: u64,8 revision: u64,
9 _start: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),9 _start: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
10 _stop: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),10 _stop: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
11 _initialize: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status),11 _initialize: *const fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status,
12 _reset: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status),12 _reset: *const fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status,
13 _shutdown: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status),13 _shutdown: *const fn (*const SimpleNetworkProtocol) callconv(.C) Status,
14 _receive_filters: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status),14 _receive_filters: *const 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),15 _station_address: *const fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
16 _statistics: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status),16 _statistics: *const 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),17 _mcast_ip_to_mac: *const 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),18 _nvdata: *const fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status,
19 _get_status: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status),19 _get_status: *const 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),20 _transmit: *const 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),21 _receive: *const fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status,
22 wait_for_packet: Event,22 wait_for_packet: Event,
23 mode: *SimpleNetworkMode,23 mode: *SimpleNetworkMode,
2424
lib/std/os/uefi/protocols/simple_pointer_protocol.zig+2-2
...@@ -6,8 +6,8 @@ const Status = uefi.Status;...@@ -6,8 +6,8 @@ const Status = uefi.Status;
66
7/// Protocol for mice7/// Protocol for mice
8pub const SimplePointerProtocol = struct {8pub const SimplePointerProtocol = struct {
9 _reset: std.meta.FnPtr(fn (*const SimplePointerProtocol, bool) callconv(.C) Status),9 _reset: *const fn (*const SimplePointerProtocol, bool) callconv(.C) Status,
10 _get_state: std.meta.FnPtr(fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status),10 _get_state: *const fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status,
11 wait_for_input: Event,11 wait_for_input: Event,
12 mode: *SimplePointerMode,12 mode: *SimplePointerMode,
1313
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+6-6
...@@ -6,12 +6,12 @@ const Status = uefi.Status;...@@ -6,12 +6,12 @@ const Status = uefi.Status;
66
7/// Character input devices, e.g. Keyboard7/// Character input devices, e.g. Keyboard
8pub const SimpleTextInputExProtocol = extern struct {8pub const SimpleTextInputExProtocol = extern struct {
9 _reset: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status),9 _reset: *const fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status,
10 _read_key_stroke_ex: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status),10 _read_key_stroke_ex: *const fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status,
11 wait_for_key_ex: Event,11 wait_for_key_ex: Event,
12 _set_state: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status),12 _set_state: *const 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),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: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status),14 _unregister_key_notify: *const fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status,
1515
16 /// Resets the input device hardware.16 /// Resets the input device hardware.
17 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status {17 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status {
...@@ -29,7 +29,7 @@ pub const SimpleTextInputExProtocol = extern struct {...@@ -29,7 +29,7 @@ pub const SimpleTextInputExProtocol = extern struct {
29 }29 }
3030
31 /// Register a notification function for a particular keystroke for the input device.31 /// 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 {
33 return self._register_key_notify(self, key_data, notify, handle);33 return self._register_key_notify(self, key_data, notify, handle);
34 }34 }
3535
lib/std/os/uefi/protocols/simple_text_input_protocol.zig+2-2
...@@ -7,8 +7,8 @@ const Status = uefi.Status;...@@ -7,8 +7,8 @@ const Status = uefi.Status;
77
8/// Character input devices, e.g. Keyboard8/// Character input devices, e.g. Keyboard
9pub const SimpleTextInputProtocol = extern struct {9pub const SimpleTextInputProtocol = extern struct {
10 _reset: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status),10 _reset: *const fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status,
11 _read_key_stroke: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status),11 _read_key_stroke: *const fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status,
12 wait_for_key: Event,12 wait_for_key: Event,
1313
14 /// Resets the input device hardware.14 /// 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;...@@ -5,15 +5,15 @@ const Status = uefi.Status;
55
6/// Character output devices6/// Character output devices
7pub const SimpleTextOutputProtocol = extern struct {7pub const SimpleTextOutputProtocol = extern struct {
8 _reset: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status),8 _reset: *const fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
9 _output_string: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status),9 _output_string: *const fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status,
10 _test_string: std.meta.FnPtr(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: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status),11 _query_mode: *const fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status,
12 _set_mode: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status),12 _set_mode: *const fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
13 _set_attribute: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status),13 _set_attribute: *const fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
14 _clear_screen: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol) callconv(.C) Status),14 _clear_screen: *const fn (*const SimpleTextOutputProtocol) callconv(.C) Status,
15 _set_cursor_position: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status),15 _set_cursor_position: *const fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status,
16 _enable_cursor: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status),16 _enable_cursor: *const fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
17 mode: *SimpleTextOutputMode,17 mode: *SimpleTextOutputMode,
1818
19 /// Resets the text output device hardware.19 /// 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;...@@ -10,13 +10,13 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
10const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;10const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
1111
12pub const Udp6Protocol = extern struct {12pub const Udp6Protocol = extern struct {
13 _get_mode_data: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status),13 _get_mode_data: *const fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
14 _configure: std.meta.FnPtr(fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status),14 _configure: *const fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status,
15 _groups: std.meta.FnPtr(fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status),15 _groups: *const fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status,
16 _transmit: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status),16 _transmit: *const fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
17 _receive: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status),17 _receive: *const fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
18 _cancel: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status),18 _cancel: *const fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status,
19 _poll: std.meta.FnPtr(fn (*const Udp6Protocol) callconv(.C) Status),19 _poll: *const fn (*const Udp6Protocol) callconv(.C) Status,
2020
21 pub fn getModeData(self: *const Udp6Protocol, udp6_config_data: ?*Udp6ConfigData, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {21 pub fn getModeData(self: *const Udp6Protocol, udp6_config_data: ?*Udp6ConfigData, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {
22 return self._get_mode_data(self, udp6_config_data, ip6_mode_data, mnp_config_data, snp_mode_data);22 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;...@@ -5,8 +5,8 @@ const Guid = uefi.Guid;
5const Status = uefi.Status;5const Status = uefi.Status;
66
7pub const Udp6ServiceBindingProtocol = extern struct {7pub const Udp6ServiceBindingProtocol = extern struct {
8 _create_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: std.meta.FnPtr(fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status),9 _destroy_child: *const fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status,
1010
11 pub fn createChild(self: *const Udp6ServiceBindingProtocol, handle: *?Handle) Status {11 pub fn createChild(self: *const Udp6ServiceBindingProtocol, handle: *?Handle) Status {
12 return self._create_child(self, handle);12 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 {...@@ -22,138 +22,138 @@ pub const BootServices = extern struct {
22 hdr: TableHeader,22 hdr: TableHeader,
2323
24 /// Raises a task's priority level and returns its previous level.24 /// 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
27 /// Restores a task's priority level to its previous value.27 /// 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
30 /// Allocates memory pages from the system.30 /// 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
33 /// Frees memory pages.33 /// 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
36 /// Returns the current memory map.36 /// 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
39 /// Allocates pool memory.39 /// 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
42 /// Returns pool memory to the system.42 /// 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
45 /// Creates an event.45 /// 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
48 /// Sets the type of timer and the trigger time for a timer event.48 /// 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
51 /// Stops execution until an event is signaled.51 /// 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
54 /// Signals an event.54 /// Signals an event.
55 signalEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status),55 signalEvent: *const fn (event: Event) callconv(.C) Status,
5656
57 /// Closes an event.57 /// Closes an event.
58 closeEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status),58 closeEvent: *const fn (event: Event) callconv(.C) Status,
5959
60 /// Checks whether an event is in the signaled state.60 /// 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
63 /// Installs a protocol interface on a device handle. If the handle does not exist, it is created63 /// Installs a protocol interface on a device handle. If the handle does not exist, it is created
64 /// and added to the list of handles in the system. installMultipleProtocolInterfaces()64 /// and added to the list of handles in the system. installMultipleProtocolInterfaces()
65 /// performs more error checking than installProtocolInterface(), so its use is recommended over this.65 /// 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
68 /// Reinstalls a protocol interface on a device handle68 /// 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
71 /// Removes a protocol interface from a device handle. Usage of71 /// Removes a protocol interface from a device handle. Usage of
72 /// uninstallMultipleProtocolInterfaces is recommended over this.72 /// 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
75 /// Queries a handle to determine if it supports a specified protocol.75 /// 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
78 reserved: *anyopaque,78 reserved: *anyopaque,
7979
80 /// Creates an event that is to be signaled whenever an interface is installed for a specified protocol.80 /// 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
83 /// Returns an array of handles that support a specified protocol.83 /// 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
86 /// Locates the handle to a device on the device path that supports the specified protocol86 /// 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
89 /// Adds, updates, or removes a configuration table entry from the EFI System Table.89 /// 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
92 /// Loads an EFI image into memory.92 /// 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
95 /// Transfers control to a loaded image's entry point.95 /// 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
98 /// Terminates a loaded EFI image and returns control to boot services.98 /// 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
101 /// Unloads an image.101 /// 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
104 /// Terminates all boot services.104 /// 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
107 /// Returns a monotonically increasing count for the platform.107 /// 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
110 /// Induces a fine-grained stall.110 /// 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
113 /// Sets the system's watchdog timer.113 /// 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
116 /// Connects one or more drives to a controller.116 /// 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
119 // Disconnects one or more drivers from a controller119 // 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
122 /// Queries a handle to determine if it supports a specified protocol.122 /// 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
125 /// Closes a protocol on a handle that was opened using openProtocol().125 /// 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
128 /// Retrieves the list of agents that currently have a protocol interface opened.128 /// 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
131 /// Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.131 /// 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
134 /// Returns an array of handles that support the requested protocol in a buffer allocated from pool.134 /// 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
137 /// Returns the first protocol instance that matches the given protocol.137 /// 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
140 /// Installs one or more protocol interfaces into the boot services environment140 /// 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
143 /// Removes one or more protocol interfaces into the boot services environment143 /// 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
146 /// Computes and returns a 32-bit CRC for a data buffer.146 /// 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
149 /// Copies the contents of one buffer to another buffer149 /// 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
152 /// Fills a buffer with a specified value152 /// 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
155 /// Creates an event in a group.155 /// 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
158 /// Opens a protocol with a structure as the loaded image for a UEFI application158 /// Opens a protocol with a structure as the loaded image for a UEFI application
159 pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol {159 pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol {
...@@ -191,7 +191,7 @@ pub const BootServices = extern struct {...@@ -191,7 +191,7 @@ pub const BootServices = extern struct {
191 pub const tpl_high_level: usize = 31;191 pub const tpl_high_level: usize = 31;
192};192};
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
196pub const TimerDelay = enum(u32) {196pub const TimerDelay = enum(u32) {
197 TimerCancel,197 TimerCancel,
lib/std/os/uefi/tables/runtime_services.zig+14-14
...@@ -19,50 +19,50 @@ pub const RuntimeServices = extern struct {...@@ -19,50 +19,50 @@ pub const RuntimeServices = extern struct {
19 hdr: TableHeader,19 hdr: TableHeader,
2020
21 /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.21 /// 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
24 /// Sets the current local time and date information24 /// 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
27 /// Returns the current wakeup alarm clock setting27 /// 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
30 /// Sets the system wakeup alarm clock time30 /// 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
33 /// Changes the runtime addressing mode of EFI firmware from physical to virtual.33 /// 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
36 /// Determines the new virtual address that is to be used on subsequent memory accesses.36 /// 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
39 /// Returns the value of a variable.39 /// 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
42 /// Enumerates the current variable names.42 /// 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
45 /// Sets the value of a variable.45 /// 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
48 /// Return the next high 32 bits of the platform's monotonic counter48 /// 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
51 /// Resets the entire platform.51 /// 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
54 /// Passes capsules to the firmware with both virtual and physical mapping.54 /// Passes capsules to the firmware with both virtual and physical mapping.
55 /// Depending on the intended consumption, the firmware may process the capsule immediately.55 /// Depending on the intended consumption, the firmware may process the capsule immediately.
56 /// If the payload should persist across a system reset, the reset value returned from56 /// If the payload should persist across a system reset, the reset value returned from
57 /// `queryCapsuleCapabilities` must be passed into resetSystem and will cause the capsule57 /// `queryCapsuleCapabilities` must be passed into resetSystem and will cause the capsule
58 /// to be processed by the firmware as part of the reset process.58 /// 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
61 /// Returns if the capsule can be supported via `updateCapsule`61 /// 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
64 /// Returns information about the EFI variables64 /// 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
67 pub const signature: u64 = 0x56524553544e5552;67 pub const signature: u64 = 0x56524553544e5552;
68};68};
lib/std/os/windows.zig+12-12
...@@ -2696,7 +2696,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;...@@ -2696,7 +2696,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
2696pub const MEM_DECOMMIT = 0x4000;2696pub const MEM_DECOMMIT = 0x4000;
2697pub const MEM_RELEASE = 0x8000;2697pub 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;
2700pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;2700pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
27012701
2702pub const WIN32_FIND_DATAW = extern struct {2702pub const WIN32_FIND_DATAW = extern struct {
...@@ -2869,7 +2869,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {...@@ -2869,7 +2869,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {
2869pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;2869pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
2870pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;2870pub 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
2874pub const PROV_RSA_FULL = 1;2874pub const PROV_RSA_FULL = 1;
28752875
...@@ -2922,14 +2922,14 @@ pub const RTL_QUERY_REGISTRY_TABLE = extern struct {...@@ -2922,14 +2922,14 @@ pub const RTL_QUERY_REGISTRY_TABLE = extern struct {
2922 DefaultLength: ULONG,2922 DefaultLength: ULONG,
2923};2923};
29242924
2925pub const RTL_QUERY_REGISTRY_ROUTINE = ?std.meta.FnPtr(fn (2925pub const RTL_QUERY_REGISTRY_ROUTINE = ?*const fn (
2926 PWSTR,2926 PWSTR,
2927 ULONG,2927 ULONG,
2928 ?*anyopaque,2928 ?*anyopaque,
2929 ULONG,2929 ULONG,
2930 ?*anyopaque,2930 ?*anyopaque,
2931 ?*anyopaque,2931 ?*anyopaque,
2932) callconv(WINAPI) NTSTATUS);2932) callconv(WINAPI) NTSTATUS;
29332933
2934/// Path is a full path2934/// Path is a full path
2935pub const RTL_REGISTRY_ABSOLUTE = 0;2935pub const RTL_REGISTRY_ABSOLUTE = 0;
...@@ -3026,7 +3026,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;...@@ -3026,7 +3026,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;
3026pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;3026pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
3027pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;3027pub 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
3031pub const FILE_NOTIFY_CHANGE_CREATION = 64;3031pub const FILE_NOTIFY_CHANGE_CREATION = 64;
3032pub const FILE_NOTIFY_CHANGE_SIZE = 8;3032pub const FILE_NOTIFY_CHANGE_SIZE = 8;
...@@ -3079,7 +3079,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {...@@ -3079,7 +3079,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {
3079pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;3079pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
3080pub const INIT_ONCE = RTL_RUN_ONCE;3080pub const INIT_ONCE = RTL_RUN_ONCE;
3081pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;3081pub 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
3084pub const RTL_RUN_ONCE = extern struct {3084pub const RTL_RUN_ONCE = extern struct {
3085 Ptr: ?*anyopaque,3085 Ptr: ?*anyopaque,
...@@ -3382,7 +3382,7 @@ pub const EXCEPTION_POINTERS = extern struct {...@@ -3382,7 +3382,7 @@ pub const EXCEPTION_POINTERS = extern struct {
3382 ContextRecord: *std.os.windows.CONTEXT,3382 ContextRecord: *std.os.windows.CONTEXT,
3383};3383};
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
3387pub const OBJECT_ATTRIBUTES = extern struct {3387pub const OBJECT_ATTRIBUTES = extern struct {
3388 Length: ULONG,3388 Length: ULONG,
...@@ -3658,7 +3658,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {...@@ -3658,7 +3658,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
3658 DosPath: UNICODE_STRING,3658 DosPath: UNICODE_STRING,
3659};3659};
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
3663pub const FILE_BOTH_DIR_INFORMATION = extern struct {3663pub const FILE_BOTH_DIR_INFORMATION = extern struct {
3664 NextEntryOffset: ULONG,3664 NextEntryOffset: ULONG,
...@@ -3678,7 +3678,7 @@ pub const FILE_BOTH_DIR_INFORMATION = extern struct {...@@ -3678,7 +3678,7 @@ pub const FILE_BOTH_DIR_INFORMATION = extern struct {
3678};3678};
3679pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION;3679pub 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
3683pub const CURDIR = extern struct {3683pub const CURDIR = extern struct {
3684 DosPath: UNICODE_STRING,3684 DosPath: UNICODE_STRING,
...@@ -3750,8 +3750,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct {...@@ -3750,8 +3750,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct {
3750 PeakUsage: SIZE_T,3750 PeakUsage: SIZE_T,
3751};3751};
37523752
3753pub const PENUM_PAGE_FILE_CALLBACKW = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) 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 = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL);3754pub const PENUM_PAGE_FILE_CALLBACKA = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL;
37553755
3756pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {3756pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {
3757 BasicInfo: PSAPI_WS_WATCH_INFORMATION,3757 BasicInfo: PSAPI_WS_WATCH_INFORMATION,
...@@ -3851,7 +3851,7 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2;...@@ -3851,7 +3851,7 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2;
3851pub const CTRL_LOGOFF_EVENT: DWORD = 5;3851pub const CTRL_LOGOFF_EVENT: DWORD = 5;
3852pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;3852pub 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
3856/// Processor feature enumeration.3856/// Processor feature enumeration.
3857pub const PF = enum(DWORD) {3857pub 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...@@ -39,7 +39,7 @@ fn selectSymbol(comptime function_static: anytype, function_dynamic: @TypeOf(fun
3939
40// === Messages ===40// === 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
44pub const MSG = extern struct {44pub const MSG = extern struct {
45 hWnd: ?HWND,45 hWnd: ?HWND,
...@@ -1056,7 +1056,7 @@ pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:...@@ -1056,7 +1056,7 @@ pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:
1056}1056}
10571057
1058pub extern "user32" fn GetMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL;1058pub 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;
1060pub fn getMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void {1060pub fn getMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void {
1061 const function = selectSymbol(GetMessageW, pfnGetMessageW, .win2k);1061 const function = selectSymbol(GetMessageW, pfnGetMessageW, .win2k);
10621062
...@@ -1087,7 +1087,7 @@ pub fn peekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:...@@ -1087,7 +1087,7 @@ pub fn peekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax:
1087}1087}
10881088
1089pub extern "user32" fn PeekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) callconv(WINAPI) BOOL;1089pub 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;
1091pub fn peekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool {1091pub fn peekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool {
1092 const function = selectSymbol(PeekMessageW, pfnPeekMessageW, .win2k);1092 const function = selectSymbol(PeekMessageW, pfnPeekMessageW, .win2k);
10931093
...@@ -1112,7 +1112,7 @@ pub fn dispatchMessageA(lpMsg: *const MSG) LRESULT {...@@ -1112,7 +1112,7 @@ pub fn dispatchMessageA(lpMsg: *const MSG) LRESULT {
1112}1112}
11131113
1114pub extern "user32" fn DispatchMessageW(lpMsg: *const MSG) callconv(WINAPI) LRESULT;1114pub 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;
1116pub fn dispatchMessageW(lpMsg: *const MSG) LRESULT {1116pub fn dispatchMessageW(lpMsg: *const MSG) LRESULT {
1117 const function = selectSymbol(DispatchMessageW, pfnDispatchMessageW, .win2k);1117 const function = selectSymbol(DispatchMessageW, pfnDispatchMessageW, .win2k);
1118 return function(lpMsg);1118 return function(lpMsg);
...@@ -1129,7 +1129,7 @@ pub fn defWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRE...@@ -1129,7 +1129,7 @@ pub fn defWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRE
1129}1129}
11301130
1131pub extern "user32" fn DefWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT;1131pub 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;
1133pub fn defWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT {1133pub fn defWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT {
1134 const function = selectSymbol(DefWindowProcW, pfnDefWindowProcW, .win2k);1134 const function = selectSymbol(DefWindowProcW, pfnDefWindowProcW, .win2k);
1135 return function(hWnd, Msg, wParam, lParam);1135 return function(hWnd, Msg, wParam, lParam);
...@@ -1191,7 +1191,7 @@ pub fn registerClassExA(window_class: *const WNDCLASSEXA) !ATOM {...@@ -1191,7 +1191,7 @@ pub fn registerClassExA(window_class: *const WNDCLASSEXA) !ATOM {
1191}1191}
11921192
1193pub extern "user32" fn RegisterClassExW(*const WNDCLASSEXW) callconv(WINAPI) ATOM;1193pub 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;
1195pub fn registerClassExW(window_class: *const WNDCLASSEXW) !ATOM {1195pub fn registerClassExW(window_class: *const WNDCLASSEXW) !ATOM {
1196 const function = selectSymbol(RegisterClassExW, pfnRegisterClassExW, .win2k);1196 const function = selectSymbol(RegisterClassExW, pfnRegisterClassExW, .win2k);
1197 const atom = function(window_class);1197 const atom = function(window_class);
...@@ -1215,7 +1215,7 @@ pub fn unregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) !void...@@ -1215,7 +1215,7 @@ pub fn unregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) !void
1215}1215}
12161216
1217pub extern "user32" fn UnregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) callconv(WINAPI) BOOL;1217pub 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;
1219pub fn unregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) !void {1219pub fn unregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) !void {
1220 const function = selectSymbol(UnregisterClassW, pfnUnregisterClassW, .win2k);1220 const function = selectSymbol(UnregisterClassW, pfnUnregisterClassW, .win2k);
1221 if (function(lpClassName, hInstance) == 0) {1221 if (function(lpClassName, hInstance) == 0) {
...@@ -1292,7 +1292,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName:...@@ -1292,7 +1292,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName:
1292}1292}
12931293
1294pub 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;1294pub 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;
1296pub 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 {1296pub 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 {
1297 const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k);1297 const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k);
1298 const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam);1298 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 {...@@ -1382,7 +1382,7 @@ pub fn getWindowLongA(hWnd: HWND, nIndex: i32) !i32 {
1382}1382}
13831383
1384pub extern "user32" fn GetWindowLongW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG;1384pub 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;
1386pub fn getWindowLongW(hWnd: HWND, nIndex: i32) !i32 {1386pub fn getWindowLongW(hWnd: HWND, nIndex: i32) !i32 {
1387 const function = selectSymbol(GetWindowLongW, pfnGetWindowLongW, .win2k);1387 const function = selectSymbol(GetWindowLongW, pfnGetWindowLongW, .win2k);
13881388
...@@ -1415,7 +1415,7 @@ pub fn getWindowLongPtrA(hWnd: HWND, nIndex: i32) !isize {...@@ -1415,7 +1415,7 @@ pub fn getWindowLongPtrA(hWnd: HWND, nIndex: i32) !isize {
1415}1415}
14161416
1417pub extern "user32" fn GetWindowLongPtrW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG_PTR;1417pub 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;
1419pub fn getWindowLongPtrW(hWnd: HWND, nIndex: i32) !isize {1419pub fn getWindowLongPtrW(hWnd: HWND, nIndex: i32) !isize {
1420 if (@sizeOf(LONG_PTR) == 4) return getWindowLongW(hWnd, nIndex);1420 if (@sizeOf(LONG_PTR) == 4) return getWindowLongW(hWnd, nIndex);
1421 const function = selectSymbol(GetWindowLongPtrW, pfnGetWindowLongPtrW, .win2k);1421 const function = selectSymbol(GetWindowLongPtrW, pfnGetWindowLongPtrW, .win2k);
...@@ -1449,7 +1449,7 @@ pub fn setWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {...@@ -1449,7 +1449,7 @@ pub fn setWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
1449}1449}
14501450
1451pub extern "user32" fn SetWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: LONG) callconv(WINAPI) LONG;1451pub 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;
1453pub fn setWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {1453pub fn setWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 {
1454 const function = selectSymbol(SetWindowLongW, pfnSetWindowLongW, .win2k);1454 const function = selectSymbol(SetWindowLongW, pfnSetWindowLongW, .win2k);
14551455
...@@ -1484,7 +1484,7 @@ pub fn setWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {...@@ -1484,7 +1484,7 @@ pub fn setWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
1484}1484}
14851485
1486pub extern "user32" fn SetWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: LONG_PTR) callconv(WINAPI) LONG_PTR;1486pub 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;
1488pub fn setWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {1488pub fn setWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize {
1489 if (@sizeOf(LONG_PTR) == 4) return setWindowLongW(hWnd, nIndex, dwNewLong);1489 if (@sizeOf(LONG_PTR) == 4) return setWindowLongW(hWnd, nIndex, dwNewLong);
1490 const function = selectSymbol(SetWindowLongPtrW, pfnSetWindowLongPtrW, .win2k);1490 const function = selectSymbol(SetWindowLongPtrW, pfnSetWindowLongPtrW, .win2k);
...@@ -1580,7 +1580,7 @@ pub fn messageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8,...@@ -1580,7 +1580,7 @@ pub fn messageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8,
1580}1580}
15811581
1582pub extern "user32" fn MessageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: ?[*:0]const u16, uType: UINT) callconv(WINAPI) i32;1582pub 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;
1584pub fn messageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: [*:0]const u16, uType: u32) !i32 {1584pub fn messageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: [*:0]const u16, uType: u32) !i32 {
1585 const function = selectSymbol(MessageBoxW, pfnMessageBoxW, .win2k);1585 const function = selectSymbol(MessageBoxW, pfnMessageBoxW, .win2k);
1586 const value = function(hWnd, lpText, lpCaption, uType);1586 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;...@@ -942,7 +942,7 @@ pub const UDP_NOCHECKSUM = 1;
942pub const UDP_CHECKSUM_COVERAGE = 20;942pub const UDP_CHECKSUM_COVERAGE = 20;
943pub const GAI_STRERROR_BUFFER_SIZE = 1024;943pub const GAI_STRERROR_BUFFER_SIZE = 1024;
944944
945pub const LPCONDITIONPROC = std.meta.FnPtr(fn (945pub const LPCONDITIONPROC = *const fn (
946 lpCallerId: *WSABUF,946 lpCallerId: *WSABUF,
947 lpCallerData: *WSABUF,947 lpCallerData: *WSABUF,
948 lpSQOS: *QOS,948 lpSQOS: *QOS,
...@@ -951,14 +951,14 @@ pub const LPCONDITIONPROC = std.meta.FnPtr(fn (...@@ -951,14 +951,14 @@ pub const LPCONDITIONPROC = std.meta.FnPtr(fn (
951 lpCalleeData: *WSABUF,951 lpCalleeData: *WSABUF,
952 g: *u32,952 g: *u32,
953 dwCallbackData: usize,953 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 (
957 dwError: u32,957 dwError: u32,
958 cbTransferred: u32,958 cbTransferred: u32,
959 lpOverlapped: *OVERLAPPED,959 lpOverlapped: *OVERLAPPED,
960 dwFlags: u32,960 dwFlags: u32,
961) callconv(WINAPI) void);961) callconv(WINAPI) void;
962962
963pub const FLOWSPEC = extern struct {963pub const FLOWSPEC = extern struct {
964 TokenRate: u32,964 TokenRate: u32,
...@@ -1173,7 +1173,7 @@ pub const TRANSMIT_FILE_BUFFERS = extern struct {...@@ -1173,7 +1173,7 @@ pub const TRANSMIT_FILE_BUFFERS = extern struct {
1173 TailLength: u32,1173 TailLength: u32,
1174};1174};
11751175
1176pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn (1176pub const LPFN_TRANSMITFILE = *const fn (
1177 hSocket: SOCKET,1177 hSocket: SOCKET,
1178 hFile: HANDLE,1178 hFile: HANDLE,
1179 nNumberOfBytesToWrite: u32,1179 nNumberOfBytesToWrite: u32,
...@@ -1181,9 +1181,9 @@ pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn (...@@ -1181,9 +1181,9 @@ pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn (
1181 lpOverlapped: ?*OVERLAPPED,1181 lpOverlapped: ?*OVERLAPPED,
1182 lpTransmitBuffers: ?*TRANSMIT_FILE_BUFFERS,1182 lpTransmitBuffers: ?*TRANSMIT_FILE_BUFFERS,
1183 dwReserved: u32,1183 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 (
1187 sListenSocket: SOCKET,1187 sListenSocket: SOCKET,
1188 sAcceptSocket: SOCKET,1188 sAcceptSocket: SOCKET,
1189 lpOutputBuffer: *anyopaque,1189 lpOutputBuffer: *anyopaque,
...@@ -1192,9 +1192,9 @@ pub const LPFN_ACCEPTEX = std.meta.FnPtr(fn (...@@ -1192,9 +1192,9 @@ pub const LPFN_ACCEPTEX = std.meta.FnPtr(fn (
1192 dwRemoteAddressLength: u32,1192 dwRemoteAddressLength: u32,
1193 lpdwBytesReceived: *u32,1193 lpdwBytesReceived: *u32,
1194 lpOverlapped: *OVERLAPPED,1194 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 (
1198 lpOutputBuffer: *anyopaque,1198 lpOutputBuffer: *anyopaque,
1199 dwReceiveDataLength: u32,1199 dwReceiveDataLength: u32,
1200 dwLocalAddressLength: u32,1200 dwLocalAddressLength: u32,
...@@ -1203,29 +1203,29 @@ pub const LPFN_GETACCEPTEXSOCKADDRS = std.meta.FnPtr(fn (...@@ -1203,29 +1203,29 @@ pub const LPFN_GETACCEPTEXSOCKADDRS = std.meta.FnPtr(fn (
1203 LocalSockaddrLength: *i32,1203 LocalSockaddrLength: *i32,
1204 RemoteSockaddr: **sockaddr,1204 RemoteSockaddr: **sockaddr,
1205 RemoteSockaddrLength: *i32,1205 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 (
1209 s: SOCKET,1209 s: SOCKET,
1210 lpMsg: *const std.x.os.Socket.Message,1210 lpMsg: *const std.x.os.Socket.Message,
1211 dwFlags: u32,1211 dwFlags: u32,
1212 lpNumberOfBytesSent: ?*u32,1212 lpNumberOfBytesSent: ?*u32,
1213 lpOverlapped: ?*OVERLAPPED,1213 lpOverlapped: ?*OVERLAPPED,
1214 lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE,1214 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 (
1218 s: SOCKET,1218 s: SOCKET,
1219 lpMsg: *std.x.os.Socket.Message,1219 lpMsg: *std.x.os.Socket.Message,
1220 lpdwNumberOfBytesRecv: ?*u32,1220 lpdwNumberOfBytesRecv: ?*u32,
1221 lpOverlapped: ?*OVERLAPPED,1221 lpOverlapped: ?*OVERLAPPED,
1222 lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE,1222 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 (
1226 lParam: LPARAM,1226 lParam: LPARAM,
1227 hAsyncTaskHandle: HANDLE,1227 hAsyncTaskHandle: HANDLE,
1228) callconv(WINAPI) void);1228) callconv(WINAPI) void;
12291229
1230pub const SERVICE_ASYNC_INFO = extern struct {1230pub const SERVICE_ASYNC_INFO = extern struct {
1231 lpServiceCallbackProc: LPSERVICE_CALLBACK_PROC,1231 lpServiceCallbackProc: LPSERVICE_CALLBACK_PROC,
...@@ -1233,11 +1233,11 @@ pub const SERVICE_ASYNC_INFO = extern struct {...@@ -1233,11 +1233,11 @@ pub const SERVICE_ASYNC_INFO = extern struct {
1233 hAsyncTaskHandle: HANDLE,1233 hAsyncTaskHandle: HANDLE,
1234};1234};
12351235
1236pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = std.meta.FnPtr(fn (1236pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = *const fn (
1237 dwError: u32,1237 dwError: u32,
1238 dwBytes: u32,1238 dwBytes: u32,
1239 lpOverlapped: *OVERLAPPED,1239 lpOverlapped: *OVERLAPPED,
1240) callconv(WINAPI) void);1240) callconv(WINAPI) void;
12411241
1242pub const fd_set = extern struct {1242pub const fd_set = extern struct {
1243 fd_count: u32,1243 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 {...@@ -338,12 +338,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type {
338 };338 };
339}339}
340340
341const we_are_testing_this_with_stage1_which_leaks_comptime_memory = true;
342
343test "PackedIntArray" {341test "PackedIntArray" {
344 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.342 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
345 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;343 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
348 @setEvalBranchQuota(10000);348 @setEvalBranchQuota(10000);
349 const max_bits = 256;349 const max_bits = 256;
...@@ -405,7 +405,9 @@ test "PackedIntArray initAllTo" {...@@ -405,7 +405,9 @@ test "PackedIntArray initAllTo" {
405test "PackedIntSlice" {405test "PackedIntSlice" {
406 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.406 // TODO @setEvalBranchQuota generates panics in wasm32. Investigate.
407 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;407 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
410 @setEvalBranchQuota(10000);412 @setEvalBranchQuota(10000);
411 const max_bits = 256;413 const max_bits = 256;
...@@ -444,7 +446,9 @@ test "PackedIntSlice" {...@@ -444,7 +446,9 @@ test "PackedIntSlice" {
444}446}
445447
446test "PackedIntSlice of PackedInt(Array/Slice)" {448test "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
448 const max_bits = 16;452 const max_bits = 16;
449 const int_count = 19;453 const int_count = 19;
450454
lib/std/rand.zig+1-1
...@@ -30,7 +30,7 @@ pub const RomuTrio = @import("rand/RomuTrio.zig");...@@ -30,7 +30,7 @@ pub const RomuTrio = @import("rand/RomuTrio.zig");
3030
31pub const Random = struct {31pub const Random = struct {
32 ptr: *anyopaque,32 ptr: *anyopaque,
33 fillFn: std.meta.FnPtr(fn (ptr: *anyopaque, buf: []u8) void),33 fillFn: *const fn (ptr: *anyopaque, buf: []u8) void,
3434
35 pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random {35 pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random {
36 const Ptr = @TypeOf(pointer);36 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...@@ -412,7 +412,7 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
412}412}
413413
414test "SegmentedList basic usage" {414test "SegmentedList basic usage" {
415 if (@import("builtin").zig_backend == .stage1) {415 if (false) {
416 // https://github.com/ziglang/zig/issues/11787416 // https://github.com/ziglang/zig/issues/11787
417 try testSegmentedList(0);417 try testSegmentedList(0);
418 }418 }
lib/std/simd.zig+2-4
...@@ -191,9 +191,7 @@ pub fn extract(...@@ -191,9 +191,7 @@ pub fn extract(
191}191}
192192
193test "vector patterns" {193test "vector patterns" {
194 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and194 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
195 builtin.cpu.arch == .aarch64)
196 {
197 // https://github.com/ziglang/zig/issues/12012195 // https://github.com/ziglang/zig/issues/12012
198 return error.SkipZigTest;196 return error.SkipZigTest;
199 }197 }
...@@ -419,7 +417,7 @@ test "vector prefix scan" {...@@ -419,7 +417,7 @@ test "vector prefix scan" {
419 return error.SkipZigTest;417 return error.SkipZigTest;
420 }418 }
421419
422 if (builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) {420 if (builtin.zig_backend == .stage2_llvm) {
423 // Regressed in LLVM 14:421 // Regressed in LLVM 14:
424 // https://github.com/llvm/llvm-project/issues/55522422 // https://github.com/llvm/llvm-project/issues/55522
425 return error.SkipZigTest;423 return error.SkipZigTest;
lib/std/unicode.zig+1-3
...@@ -354,9 +354,7 @@ fn testUtf16CountCodepoints() !void {...@@ -354,9 +354,7 @@ fn testUtf16CountCodepoints() !void {
354354
355test "utf16 count codepoints" {355test "utf16 count codepoints" {
356 try testUtf16CountCodepoints();356 try testUtf16CountCodepoints();
357 // TODO stage1 error: out of bounds slice357 comptime try testUtf16CountCodepoints();
358 if (@import("builtin").zig_backend != .stage1)
359 comptime try testUtf16CountCodepoints();
360}358}
361359
362test "utf8 encode" {360test "utf8 encode" {
lib/std/zig/Ast.zig-2
...@@ -2009,8 +2009,6 @@ fn fullStructInit(tree: Ast, info: full.StructInit.Components) full.StructInit {...@@ -2009,8 +2009,6 @@ fn fullStructInit(tree: Ast, info: full.StructInit.Components) full.StructInit {
20092009
2010fn fullPtrType(tree: Ast, info: full.PtrType.Components) full.PtrType {2010fn fullPtrType(tree: Ast, info: full.PtrType.Components) full.PtrType {
2011 const token_tags = tree.tokens.items(.tag);2011 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
2014 const Size = std.builtin.Type.Pointer.Size;2012 const Size = std.builtin.Type.Pointer.Size;
2015 const size: Size = switch (token_tags[info.main_token]) {2013 const size: Size = switch (token_tags[info.main_token]) {
2016 .asterisk,2014 .asterisk,
lib/std/zig/c_translation.zig+4-18
...@@ -9,19 +9,13 @@ pub fn cast(comptime DestType: type, target: anytype) DestType {...@@ -9,19 +9,13 @@ pub fn cast(comptime DestType: type, target: anytype) DestType {
9 // this function should behave like transCCast in translate-c, except it's for macros9 // this function should behave like transCCast in translate-c, except it's for macros
10 const SourceType = @TypeOf(target);10 const SourceType = @TypeOf(target);
11 switch (@typeInfo(DestType)) {11 switch (@typeInfo(DestType)) {
12 .Fn => if (builtin.zig_backend == .stage1)12 .Fn => return castToPtr(*const DestType, SourceType, target),
13 return castToPtr(DestType, SourceType, target)
14 else
15 return castToPtr(*const DestType, SourceType, target),
16 .Pointer => return castToPtr(DestType, SourceType, target),13 .Pointer => return castToPtr(DestType, SourceType, target),
17 .Optional => |dest_opt| {14 .Optional => |dest_opt| {
18 if (@typeInfo(dest_opt.child) == .Pointer) {15 if (@typeInfo(dest_opt.child) == .Pointer) {
19 return castToPtr(DestType, SourceType, target);16 return castToPtr(DestType, SourceType, target);
20 } else if (@typeInfo(dest_opt.child) == .Fn) {17 } else if (@typeInfo(dest_opt.child) == .Fn) {
21 if (builtin.zig_backend == .stage1)18 return castToPtr(?*const dest_opt.child, SourceType, target);
22 return castToPtr(DestType, SourceType, target)
23 else
24 return castToPtr(?*const dest_opt.child, SourceType, target);
25 }19 }
26 },20 },
27 .Int => {21 .Int => {
...@@ -149,7 +143,7 @@ test "cast" {...@@ -149,7 +143,7 @@ test "cast" {
149 try testing.expect(cast(?*anyopaque, -1) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))));143 try testing.expect(cast(?*anyopaque, -1) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))));
150 try testing.expect(cast(?*anyopaque, foo) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))));144 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;
153 try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0)));147 try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0)));
154 try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1))));148 try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1))));
155}149}
...@@ -160,12 +154,6 @@ pub fn sizeof(target: anytype) usize {...@@ -160,12 +154,6 @@ pub fn sizeof(target: anytype) usize {
160 switch (@typeInfo(T)) {154 switch (@typeInfo(T)) {
161 .Float, .Int, .Struct, .Union, .Array, .Bool, .Vector => return @sizeOf(T),155 .Float, .Int, .Struct, .Union, .Array, .Bool, .Vector => return @sizeOf(T),
162 .Fn => {156 .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
169 // sizeof(main) in C returns 1157 // sizeof(main) in C returns 1
170 return 1;158 return 1;
171 },159 },
...@@ -263,9 +251,7 @@ test "sizeof" {...@@ -263,9 +251,7 @@ test "sizeof" {
263 try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size);251 try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size);
264 try testing.expect(sizeof(*const [4]u8) == ptr_size);252 try testing.expect(sizeof(*const [4]u8) == ptr_size);
265253
266 if (builtin.zig_backend == .stage1) {254 if (false) { // TODO
267 try testing.expect(sizeof(sizeof) == @sizeOf(@TypeOf(sizeof)));
268 } else if (false) { // TODO
269 try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof)));255 try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof)));
270 try testing.expect(sizeof(sizeof) == 1);256 try testing.expect(sizeof(sizeof) == 1);
271 }257 }
lib/std/zig/render.zig+1-1
...@@ -2211,7 +2211,7 @@ fn renderAsm(...@@ -2211,7 +2211,7 @@ fn renderAsm(
2211 },2211 },
2212 else => unreachable,2212 else => unreachable,
2213 }2213 }
2214 } else unreachable; // TODO shouldn't need this on while(true)2214 }
2215}2215}
22162216
2217fn renderCall(2217fn renderCall(
lib/std/zig/string_literal.zig+1-1
...@@ -266,7 +266,7 @@ pub fn parseWrite(writer: anytype, bytes: []const u8) error{OutOfMemory}!Result...@@ -266,7 +266,7 @@ pub fn parseWrite(writer: anytype, bytes: []const u8) error{OutOfMemory}!Result
266 index += 1;266 index += 1;
267 },267 },
268 }268 }
269 } else unreachable; // TODO should not need else unreachable on while(true)269 }
270}270}
271271
272/// Higher level API. Does not return extra info about parse errors.272/// 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(...@@ -5431,11 +5431,6 @@ pub fn build_crt_file(
5431 });5431 });
5432 errdefer comp.gpa.free(basename);5432 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 };
5439 const sub_compilation = try Compilation.create(comp.gpa, .{5434 const sub_compilation = try Compilation.create(comp.gpa, .{
5440 .local_cache_directory = comp.global_cache_directory,5435 .local_cache_directory = comp.global_cache_directory,
5441 .global_cache_directory = comp.global_cache_directory,5436 .global_cache_directory = comp.global_cache_directory,
...@@ -5447,7 +5442,10 @@ pub fn build_crt_file(...@@ -5447,7 +5442,10 @@ pub fn build_crt_file(
5447 .output_mode = output_mode,5442 .output_mode = output_mode,
5448 .thread_pool = comp.thread_pool,5443 .thread_pool = comp.thread_pool,
5449 .libc_installation = comp.bin_file.options.libc_installation,5444 .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 },
5451 .optimize_mode = comp.compilerRtOptMode(),5449 .optimize_mode = comp.compilerRtOptMode(),
5452 .want_sanitize_c = false,5450 .want_sanitize_c = false,
5453 .want_stack_check = false,5451 .want_stack_check = false,
...@@ -5492,15 +5490,16 @@ pub fn build_crt_file(...@@ -5492,15 +5490,16 @@ pub fn build_crt_file(
5492 });5490 });
5493}5491}
54945492
5495pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void {5493pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void {
5496 // Avoid deadlocking on building import libs such as kernel32.lib5494 // Avoid deadlocking on building import libs such as kernel32.lib
5497 // This can happen when the user uses `build-exe foo.obj -lkernel32` and then5495 // This can happen when the user uses `build-exe foo.obj -lkernel32` and
5498 // when we create a sub-Compilation for zig libc, it also tries to build kernel32.lib.5496 // then when we create a sub-Compilation for zig libc, it also tries to
5497 // build kernel32.lib.
5499 if (comp.bin_file.options.skip_linker_dependencies) return;5498 if (comp.bin_file.options.skip_linker_dependencies) return;
55005499
5501 // This happens when an `extern "foo"` function is referenced by the stage1 backend.5500 // This happens when an `extern "foo"` function is referenced.
5502 // If we haven't seen this library yet and we're targeting Windows, we need to queue up5501 // If we haven't seen this library yet and we're targeting Windows, we need
5503 // a work item to produce the DLL import library for this.5502 // to queue up a work item to produce the DLL import library for this.
5504 const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name);5503 const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name);
5505 if (!gop.found_existing and comp.getTarget().os.tag == .windows) {5504 if (!gop.found_existing and comp.getTarget().os.tag == .windows) {
5506 try comp.work_queue.writeItem(.{5505 try comp.work_queue.writeItem(.{
src/Module.zig+6-8
...@@ -71,7 +71,7 @@ import_table: std.StringArrayHashMapUnmanaged(*File) = .{},...@@ -71,7 +71,7 @@ import_table: std.StringArrayHashMapUnmanaged(*File) = .{},
71/// Keys are fully resolved file paths. This table owns the keys and values.71/// Keys are fully resolved file paths. This table owns the keys and values.
72embed_table: std.StringHashMapUnmanaged(*EmbedFile) = .{},72embed_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,
75/// however the end-game once the lang spec is settled will be to use a global75/// however the end-game once the lang spec is settled will be to use a global
76/// InternPool for comptime memoized objects, making this behavior consistent across all types,76/// InternPool for comptime memoized objects, making this behavior consistent across all types,
77/// not only string literals. Or, we might decide to not guarantee string literals77/// 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...@@ -3544,17 +3544,15 @@ fn freeExportList(gpa: Allocator, export_list: *ArrayListUnmanaged(*Export)) voi
3544 export_list.deinit(gpa);3544 export_list.deinit(gpa);
3545}3545}
35463546
3547// TODO https://github.com/ziglang/zig/issues/8643
3547const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8;3548const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8;
3548// TODO This is taking advantage of matching stage1 debug union layout.3549const HackDataLayout = extern struct {
3549// We need a better language feature for initializing a union with
3550// a runtime-known tag.
3551const Stage1DataLayout = extern struct {
3552 data: [8]u8 align(@alignOf(Zir.Inst.Data)),3550 data: [8]u8 align(@alignOf(Zir.Inst.Data)),
3553 safety_tag: u8,3551 safety_tag: u8,
3554};3552};
3555comptime {3553comptime {
3556 if (data_has_safety_tag) {3554 if (data_has_safety_tag) {
3557 assert(@sizeOf(Stage1DataLayout) == @sizeOf(Zir.Inst.Data));3555 assert(@sizeOf(HackDataLayout) == @sizeOf(Zir.Inst.Data));
3558 }3556 }
3559}3557}
35603558
...@@ -3695,7 +3693,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {...@@ -3695,7 +3693,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {
3695 const tags = zir.instructions.items(.tag);3693 const tags = zir.instructions.items(.tag);
3696 for (zir.instructions.items(.data)) |*data, i| {3694 for (zir.instructions.items(.data)) |*data, i| {
3697 const union_tag = Zir.Inst.Tag.data_tags[@enumToInt(tags[i])];3695 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);
3699 as_struct.* = .{3697 as_struct.* = .{
3700 .safety_tag = @enumToInt(union_tag),3698 .safety_tag = @enumToInt(union_tag),
3701 .data = safety_buffer[i],3699 .data = safety_buffer[i],
...@@ -3881,7 +3879,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {...@@ -3881,7 +3879,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {
3881 if (data_has_safety_tag) {3879 if (data_has_safety_tag) {
3882 // The `Data` union has a safety tag but in the file format we store it without.3880 // The `Data` union has a safety tag but in the file format we store it without.
3883 for (file.zir.instructions.items(.data)) |*data, i| {3881 for (file.zir.instructions.items(.data)) |*data, i| {
3884 const as_struct = @ptrCast(*const Stage1DataLayout, data);3882 const as_struct = @ptrCast(*const HackDataLayout, data);
3885 safety_buffer[i] = as_struct.data;3883 safety_buffer[i] = as_struct.data;
3886 }3884 }
3887 }3885 }
src/Sema.zig+18-24
...@@ -1359,7 +1359,7 @@ fn analyzeBodyInner(...@@ -1359,7 +1359,7 @@ fn analyzeBodyInner(
1359 break check_block.runtime_index;1359 break check_block.runtime_index;
1360 }1360 }
1361 check_block = check_block.parent.?;1361 check_block = check_block.parent.?;
1362 } else unreachable;1362 };
13631363
1364 if (@enumToInt(target_runtime_index) < @enumToInt(block.runtime_index)) {1364 if (@enumToInt(target_runtime_index) < @enumToInt(block.runtime_index)) {
1365 const runtime_src = block.runtime_cond orelse block.runtime_loop.?;1365 const runtime_src = block.runtime_cond orelse block.runtime_loop.?;
...@@ -1733,7 +1733,7 @@ fn analyzeBodyInner(...@@ -1733,7 +1733,7 @@ fn analyzeBodyInner(
1733 break always_noreturn;1733 break always_noreturn;
1734 map.putAssumeCapacity(inst, air_inst);1734 map.putAssumeCapacity(inst, air_inst);
1735 i += 1;1735 i += 1;
1736 } else unreachable;1736 };
17371737
1738 // balance out dbg_block_begins in case of early noreturn1738 // balance out dbg_block_begins in case of early noreturn
1739 const noreturn_inst = block.instructions.popOrNull();1739 const noreturn_inst = block.instructions.popOrNull();
...@@ -3478,7 +3478,7 @@ fn zirMakePtrConst(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro...@@ -3478,7 +3478,7 @@ fn zirMakePtrConst(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
3478 .store => break candidate,3478 .store => break candidate,
3479 else => break :ct,3479 else => break :ct,
3480 }3480 }
3481 } else unreachable; // TODO shouldn't need this3481 };
34823482
3483 while (true) {3483 while (true) {
3484 if (search_index == 0) break :ct;3484 if (search_index == 0) break :ct;
...@@ -3704,7 +3704,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com...@@ -3704,7 +3704,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
3704 .store => break candidate,3704 .store => break candidate,
3705 else => break :ct,3705 else => break :ct,
3706 }3706 }
3707 } else unreachable; // TODO shouldn't need this3707 };
37083708
3709 const bitcast_inst = while (true) {3709 const bitcast_inst = while (true) {
3710 if (search_index == 0) break :ct;3710 if (search_index == 0) break :ct;
...@@ -3716,7 +3716,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com...@@ -3716,7 +3716,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
3716 .bitcast => break candidate,3716 .bitcast => break candidate,
3717 else => break :ct,3717 else => break :ct,
3718 }3718 }
3719 } else unreachable; // TODO shouldn't need this3719 };
37203720
3721 const const_inst = while (true) {3721 const const_inst = while (true) {
3722 if (search_index == 0) break :ct;3722 if (search_index == 0) break :ct;
...@@ -3728,7 +3728,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com...@@ -3728,7 +3728,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
3728 .constant => break candidate,3728 .constant => break candidate,
3729 else => break :ct,3729 else => break :ct,
3730 }3730 }
3731 } else unreachable; // TODO shouldn't need this3731 };
37323732
3733 const store_op = air_datas[store_inst].bin_op;3733 const store_op = air_datas[store_inst].bin_op;
3734 const store_val = (try sema.resolveMaybeUndefVal(store_op.rhs)) orelse break :ct;3734 const store_val = (try sema.resolveMaybeUndefVal(store_op.rhs)) orelse break :ct;
...@@ -8307,7 +8307,7 @@ fn handleExternLibName(...@@ -8307,7 +8307,7 @@ fn handleExternLibName(
8307 .{ lib_name, lib_name },8307 .{ lib_name, lib_name },
8308 );8308 );
8309 }8309 }
8310 comp.stage1AddLinkLib(lib_name) catch |err| {8310 comp.addLinkLib(lib_name) catch |err| {
8311 return sema.fail(block, src_loc, "unable to add link lib '{s}': {s}", .{8311 return sema.fail(block, src_loc, "unable to add link lib '{s}': {s}", .{
8312 lib_name, @errorName(err),8312 lib_name, @errorName(err),
8313 });8313 });
...@@ -8401,15 +8401,11 @@ fn funcCommon(...@@ -8401,15 +8401,11 @@ fn funcCommon(
8401 }8401 }
8402 }8402 }
84038403
8404 // These locals are pulled out from the init expression below to work around
8405 // a stage1 compiler bug.
8406 // In the case of generic calling convention, or generic alignment, we use8404 // In the case of generic calling convention, or generic alignment, we use
8407 // default values which are only meaningful for the generic function, *not*8405 // default values which are only meaningful for the generic function, *not*
8408 // the instantiation, which can depend on comptime parameters.8406 // the instantiation, which can depend on comptime parameters.
8409 // Related proposal: https://github.com/ziglang/zig/issues/118348407 // Related proposal: https://github.com/ziglang/zig/issues/11834
8410 const cc_workaround = cc orelse .Unspecified;8408 const cc_resolved = cc orelse .Unspecified;
8411 const align_workaround = alignment orelse 0;
8412
8413 const param_types = try sema.arena.alloc(Type, block.params.items.len);8409 const param_types = try sema.arena.alloc(Type, block.params.items.len);
8414 const comptime_params = try sema.arena.alloc(bool, block.params.items.len);8410 const comptime_params = try sema.arena.alloc(bool, block.params.items.len);
8415 for (block.params.items) |param, i| {8411 for (block.params.items) |param, i| {
...@@ -8421,7 +8417,7 @@ fn funcCommon(...@@ -8421,7 +8417,7 @@ fn funcCommon(
8421 comptime_params,8417 comptime_params,
8422 i,8418 i,
8423 &is_generic,8419 &is_generic,
8424 cc_workaround,8420 cc_resolved,
8425 has_body,8421 has_body,
8426 ) catch |err| switch (err) {8422 ) catch |err| switch (err) {
8427 error.NeededSourceLocation => {8423 error.NeededSourceLocation => {
...@@ -8433,7 +8429,7 @@ fn funcCommon(...@@ -8433,7 +8429,7 @@ fn funcCommon(
8433 comptime_params,8429 comptime_params,
8434 i,8430 i,
8435 &is_generic,8431 &is_generic,
8436 cc_workaround,8432 cc_resolved,
8437 has_body,8433 has_body,
8438 );8434 );
8439 return error.AnalysisFail;8435 return error.AnalysisFail;
...@@ -8481,10 +8477,10 @@ fn funcCommon(...@@ -8481,10 +8477,10 @@ fn funcCommon(
8481 };8477 };
8482 return sema.failWithOwnedErrorMsg(msg);8478 return sema.failWithOwnedErrorMsg(msg);
8483 }8479 }
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)) {
8485 const msg = msg: {8481 const msg = msg: {
8486 const msg = try sema.errMsg(block, ret_ty_src, "return type '{}' not allowed in function with calling convention '{s}'", .{8482 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),
8488 });8484 });
8489 errdefer msg.destroy(sema.gpa);8485 errdefer msg.destroy(sema.gpa);
84908486
...@@ -8533,7 +8529,7 @@ fn funcCommon(...@@ -8533,7 +8529,7 @@ fn funcCommon(
8533 }8529 }
85348530
8535 const arch = sema.mod.getTarget().cpu.arch;8531 const arch = sema.mod.getTarget().cpu.arch;
8536 if (switch (cc_workaround) {8532 if (switch (cc_resolved) {
8537 .Unspecified, .C, .Naked, .Async, .Inline => null,8533 .Unspecified, .C, .Naked, .Async, .Inline => null,
8538 .Interrupt => switch (arch) {8534 .Interrupt => switch (arch) {
8539 .x86, .x86_64, .avr, .msp430 => null,8535 .x86, .x86_64, .avr, .msp430 => null,
...@@ -8569,13 +8565,13 @@ fn funcCommon(...@@ -8569,13 +8565,13 @@ fn funcCommon(
8569 },8565 },
8570 }) |allowed_platform| {8566 }) |allowed_platform| {
8571 return sema.fail(block, cc_src, "callconv '{s}' is only available on {s}, not {s}", .{8567 return sema.fail(block, cc_src, "callconv '{s}' is only available on {s}, not {s}", .{
8572 @tagName(cc_workaround),8568 @tagName(cc_resolved),
8573 allowed_platform,8569 allowed_platform,
8574 @tagName(arch),8570 @tagName(arch),
8575 });8571 });
8576 }8572 }
85778573
8578 if (cc_workaround == .Inline and is_noinline) {8574 if (cc_resolved == .Inline and is_noinline) {
8579 return sema.fail(block, cc_src, "'noinline' function cannot have callconv 'Inline'", .{});8575 return sema.fail(block, cc_src, "'noinline' function cannot have callconv 'Inline'", .{});
8580 }8576 }
8581 if (is_generic and sema.no_partial_func_ty) return error.GenericPoison;8577 if (is_generic and sema.no_partial_func_ty) return error.GenericPoison;
...@@ -8593,9 +8589,9 @@ fn funcCommon(...@@ -8593,9 +8589,9 @@ fn funcCommon(
8593 .param_types = param_types,8589 .param_types = param_types,
8594 .comptime_params = comptime_params.ptr,8590 .comptime_params = comptime_params.ptr,
8595 .return_type = return_type,8591 .return_type = return_type,
8596 .cc = cc_workaround,8592 .cc = cc_resolved,
8597 .cc_is_generic = cc == null,8593 .cc_is_generic = cc == null,
8598 .alignment = align_workaround,8594 .alignment = alignment orelse 0,
8599 .align_is_generic = alignment == null,8595 .align_is_generic = alignment == null,
8600 .section_is_generic = section == .generic,8596 .section_is_generic = section == .generic,
8601 .addrspace_is_generic = address_space == null,8597 .addrspace_is_generic = address_space == null,
...@@ -14964,7 +14960,7 @@ fn zirClosureGet(...@@ -14964,7 +14960,7 @@ fn zirClosureGet(
14964 break tv;14960 break tv;
14965 }14961 }
14966 scope = scope.parent.?;14962 scope = scope.parent.?;
14967 } else unreachable;14963 };
1496814964
14969 if (tv.val.tag() == .unreachable_value and !block.is_typeof and sema.func == null) {14965 if (tv.val.tag() == .unreachable_value and !block.is_typeof and sema.func == null) {
14970 const msg = msg: {14966 const msg = msg: {
...@@ -19107,8 +19103,6 @@ fn zirPtrCast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air...@@ -19107,8 +19103,6 @@ fn zirPtrCast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
19107 const operand_elem_size = operand_elem_ty.abiSize(target);19103 const operand_elem_size = operand_elem_ty.abiSize(target);
19108 const dest_elem_size = dest_elem_ty.abiSize(target);19104 const dest_elem_size = dest_elem_ty.abiSize(target);
19109 if (operand_elem_size != dest_elem_size) {19105 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.
19112 return sema.fail(block, dest_ty_src, "TODO: implement @ptrCast between slices changing the length", .{});19106 return sema.fail(block, dest_ty_src, "TODO: implement @ptrCast between slices changing the length", .{});
19113 }19107 }
19114 }19108 }
src/ThreadPool.zig+1-4
...@@ -15,10 +15,7 @@ const Runnable = struct {...@@ -15,10 +15,7 @@ const Runnable = struct {
15 runFn: RunProto,15 runFn: RunProto,
16};16};
1717
18const RunProto = switch (builtin.zig_backend) {18const RunProto = *const fn (*Runnable) void;
19 .stage1 => fn (*Runnable) void,
20 else => *const fn (*Runnable) void,
21};
2219
23pub fn init(pool: *ThreadPool, allocator: std.mem.Allocator) !void {20pub fn init(pool: *ThreadPool, allocator: std.mem.Allocator) !void {
24 pool.* = .{21 pool.* = .{
src/clang.zig+5-6
...@@ -161,12 +161,11 @@ pub const ASTUnit = opaque {...@@ -161,12 +161,11 @@ pub const ASTUnit = opaque {
161 extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager;161 extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager;
162162
163 pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls;163 pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls;
164 extern fn ZigClangASTUnit_visitLocalTopLevelDecls(*ASTUnit, context: ?*anyopaque, Fn: ?VisitorFn) bool;164 extern fn ZigClangASTUnit_visitLocalTopLevelDecls(
165165 *ASTUnit,
166 const VisitorFn = if (@import("builtin").zig_backend == .stage1)166 context: ?*anyopaque,
167 fn (?*anyopaque, *const Decl) callconv(.C) bool167 Fn: ?*const fn (?*anyopaque, *const Decl) callconv(.C) bool,
168 else168 ) bool;
169 *const fn (?*anyopaque, *const Decl) callconv(.C) bool;
170169
171 pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin;170 pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin;
172 extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator;171 extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator;
src/codegen.zig+1-42
...@@ -98,54 +98,13 @@ pub fn generateFunction(...@@ -98,54 +98,13 @@ pub fn generateFunction(
98 .aarch64_be,98 .aarch64_be,
99 .aarch64_32,99 .aarch64_32,
100 => return @import("arch/aarch64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),100 => 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),
117 .riscv64 => return @import("arch/riscv64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),101 .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),
119 .sparc64 => return @import("arch/sparc64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),102 .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),
127 .x86_64 => return @import("arch/x86_64/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),103 .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),
145 .wasm32,104 .wasm32,
146 .wasm64,105 .wasm64,
147 => return @import("arch/wasm/CodeGen.zig").generate(bin_file, src_loc, func, air, liveness, code, debug_output),106 => 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,
149 }108 }
150}109}
151110
src/codegen/c.zig+2-4
...@@ -4972,8 +4972,7 @@ fn airStructFieldPtr(f: *Function, inst: Air.Inst.Index) !CValue {...@@ -4972,8 +4972,7 @@ fn airStructFieldPtr(f: *Function, inst: Air.Inst.Index) !CValue {
49724972
4973 if (f.liveness.isUnused(inst)) {4973 if (f.liveness.isUnused(inst)) {
4974 try reap(f, inst, &.{extra.struct_operand});4974 try reap(f, inst, &.{extra.struct_operand});
4975 // TODO this @as is needed because of a stage1 bug4975 return .none;
4976 return @as(CValue, CValue.none);
4977 }4976 }
49784977
4979 const struct_ptr = try f.resolveInst(extra.struct_operand);4978 const struct_ptr = try f.resolveInst(extra.struct_operand);
...@@ -4987,8 +4986,7 @@ fn airStructFieldPtrIndex(f: *Function, inst: Air.Inst.Index, index: u8) !CValue...@@ -4987,8 +4986,7 @@ fn airStructFieldPtrIndex(f: *Function, inst: Air.Inst.Index, index: u8) !CValue
49874986
4988 if (f.liveness.isUnused(inst)) {4987 if (f.liveness.isUnused(inst)) {
4989 try reap(f, inst, &.{ty_op.operand});4988 try reap(f, inst, &.{ty_op.operand});
4990 // TODO this @as is needed because of a stage1 bug4989 return .none;
4991 return @as(CValue, CValue.none);
4992 }4990 }
49934991
4994 const struct_ptr = try f.resolveInst(ty_op.operand);4992 const struct_ptr = try f.resolveInst(ty_op.operand);
src/codegen/llvm.zig+8-8
...@@ -1392,8 +1392,9 @@ pub const Object = struct {...@@ -1392,8 +1392,9 @@ pub const Object = struct {
1392 const dir_path = file.pkg.root_src_directory.path orelse ".";1392 const dir_path = file.pkg.root_src_directory.path orelse ".";
1393 const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path));1393 const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path));
1394 defer gpa.free(sub_file_path_z);1394 defer gpa.free(sub_file_path_z);
1395 const stage1_workaround = std.fs.path.dirname(file.sub_file_path) orelse "";1395 const dir_path_z = try std.fs.path.joinZ(gpa, &.{
1396 const dir_path_z = try std.fs.path.joinZ(gpa, &.{ dir_path, stage1_workaround });1396 dir_path, std.fs.path.dirname(file.sub_file_path) orelse "",
1397 });
1397 defer gpa.free(dir_path_z);1398 defer gpa.free(dir_path_z);
1398 const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z);1399 const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z);
1399 gop.value_ptr.* = di_file.toNode();1400 gop.value_ptr.* = di_file.toNode();
...@@ -6107,12 +6108,11 @@ pub const FuncGen = struct {...@@ -6107,12 +6108,11 @@ pub const FuncGen = struct {
6107 }6108 }
61086109
6109 fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) !?*llvm.Value {6110 fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) !?*llvm.Value {
6110 // Eventually, the Zig compiler needs to be reworked to have inline assembly go6111 // Eventually, the Zig compiler needs to be reworked to have inline
6111 // through the same parsing code regardless of backend, and have LLVM-flavored6112 // assembly go through the same parsing code regardless of backend, and
6112 // inline assembly be *output* from that assembler.6113 // have LLVM-flavored inline assembly be *output* from that assembler.
6113 // We don't have such an assembler implemented yet though. For now, this6114 // We don't have such an assembler implemented yet though. For now,
6114 // implementation feeds the inline assembly code directly to LLVM, same6115 // this implementation feeds the inline assembly code directly to LLVM.
6115 // as stage1.
61166116
6117 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;6117 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
6118 const extra = self.air.extraData(Air.Asm, ty_pl.payload);6118 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 {...@@ -333,8 +333,6 @@ fn extendedUnionSize(comptime Operand: type, operand: Operand) usize {
333}333}
334334
335test "SPIR-V Section emit() - no operands" {335test "SPIR-V Section emit() - no operands" {
336 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
337
338 var section = Section{};336 var section = Section{};
339 defer section.deinit(std.testing.allocator);337 defer section.deinit(std.testing.allocator);
340338
...@@ -344,8 +342,6 @@ test "SPIR-V Section emit() - no operands" {...@@ -344,8 +342,6 @@ test "SPIR-V Section emit() - no operands" {
344}342}
345343
346test "SPIR-V Section emit() - simple" {344test "SPIR-V Section emit() - simple" {
347 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
348
349 var section = Section{};345 var section = Section{};
350 defer section.deinit(std.testing.allocator);346 defer section.deinit(std.testing.allocator);
351347
...@@ -362,8 +358,6 @@ test "SPIR-V Section emit() - simple" {...@@ -362,8 +358,6 @@ test "SPIR-V Section emit() - simple" {
362}358}
363359
364test "SPIR-V Section emit() - string" {360test "SPIR-V Section emit() - string" {
365 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
366
367 var section = Section{};361 var section = Section{};
368 defer section.deinit(std.testing.allocator);362 defer section.deinit(std.testing.allocator);
369363
...@@ -389,8 +383,6 @@ test "SPIR-V Section emit() - string" {...@@ -389,8 +383,6 @@ test "SPIR-V Section emit() - string" {
389}383}
390384
391test "SPIR-V Section emit()- extended mask" {385test "SPIR-V Section emit()- extended mask" {
392 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
393
394 var section = Section{};386 var section = Section{};
395 defer section.deinit(std.testing.allocator);387 defer section.deinit(std.testing.allocator);
396388
...@@ -415,8 +407,6 @@ test "SPIR-V Section emit()- extended mask" {...@@ -415,8 +407,6 @@ test "SPIR-V Section emit()- extended mask" {
415}407}
416408
417test "SPIR-V Section emit() - extended union" {409test "SPIR-V Section emit() - extended union" {
418 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
419
420 var section = Section{};410 var section = Section{};
421 defer section.deinit(std.testing.allocator);411 defer section.deinit(std.testing.allocator);
422412
src/main.zig+2-6
...@@ -3289,15 +3289,11 @@ fn parseCrossTargetOrReportFatalError(...@@ -3289,15 +3289,11 @@ fn parseCrossTargetOrReportFatalError(
3289 fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});3289 fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
3290 },3290 },
3291 error.UnknownObjectFormat => {3291 error.UnknownObjectFormat => {
3292 {3292 help: {
3293 var help_text = std.ArrayList(u8).init(allocator);3293 var help_text = std.ArrayList(u8).init(allocator);
3294 defer help_text.deinit();3294 defer help_text.deinit();
3295 inline for (@typeInfo(std.Target.ObjectFormat).Enum.fields) |field| {3295 inline for (@typeInfo(std.Target.ObjectFormat).Enum.fields) |field| {
3296 help_text.writer().print(" {s}\n", .{field.name}) catch3296 help_text.writer().print(" {s}\n", .{field.name}) catch break :help;
3297 // TODO change this back to `break :help`
3298 // this working around a stage1 bug.
3299 //break :help;
3300 @panic("out of memory");
3301 }3297 }
3302 std.log.info("available object formats:\n{s}", .{help_text.items});3298 std.log.info("available object formats:\n{s}", .{help_text.items});
3303 }3299 }
src/print_air.zig+1-1
...@@ -848,7 +848,7 @@ const Writer = struct {...@@ -848,7 +848,7 @@ const Writer = struct {
848 if ((bits >> 31) != 0) break :blk false;848 if ((bits >> 31) != 0) break :blk false;
849 extra_index += 1;849 extra_index += 1;
850 tomb_op_index += 31;850 tomb_op_index += 31;
851 } else unreachable;851 }
852 };852 };
853 return w.writeInstRef(s, operand, dies);853 return w.writeInstRef(s, operand, dies);
854 }854 }
src/target.zig+2-2
...@@ -523,13 +523,13 @@ pub const AtomicPtrAlignmentDiagnostics = struct {...@@ -523,13 +523,13 @@ pub const AtomicPtrAlignmentDiagnostics = struct {
523/// If ABI alignment of `ty` is OK for atomic operations, returns 0.523/// If ABI alignment of `ty` is OK for atomic operations, returns 0.
524/// Otherwise returns the alignment required on a pointer for the target524/// Otherwise returns the alignment required on a pointer for the target
525/// to perform atomic operations.525/// to perform atomic operations.
526// TODO this function does not take into account CPU features, which can affect
527// this value. Audit this!
526pub fn atomicPtrAlignment(528pub fn atomicPtrAlignment(
527 target: std.Target,529 target: std.Target,
528 ty: Type,530 ty: Type,
529 diags: *AtomicPtrAlignmentDiagnostics,531 diags: *AtomicPtrAlignmentDiagnostics,
530) AtomicPtrAlignmentError!u32 {532) 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!
533 const max_atomic_bits: u16 = switch (target.cpu.arch) {533 const max_atomic_bits: u16 = switch (target.cpu.arch) {
534 .avr,534 .avr,
535 .msp430,535 .msp430,
src/translate_c.zig+2-5
...@@ -1,6 +1,3 @@...@@ -1,6 +1,3 @@
1//! This is the userland implementation of translate-c which is used by both stage1
2//! and stage2.
3
4const std = @import("std");1const std = @import("std");
5const testing = std.testing;2const testing = std.testing;
6const assert = std.debug.assert;3const assert = std.debug.assert;
...@@ -523,7 +520,7 @@ fn declVisitorNamesOnly(c: *Context, decl: *const clang.Decl) Error!void {...@@ -523,7 +520,7 @@ fn declVisitorNamesOnly(c: *Context, decl: *const clang.Decl) Error!void {
523 child_ty = macroqualified_ty.getModifiedType().getTypePtr();520 child_ty = macroqualified_ty.getModifiedType().getTypePtr();
524 },521 },
525 else => return,522 else => return,
526 } else unreachable;523 };
527524
528 const result = try c.unnamed_typedefs.getOrPut(c.gpa, addr);525 const result = try c.unnamed_typedefs.getOrPut(c.gpa, addr);
529 if (result.found_existing) {526 if (result.found_existing) {
...@@ -629,7 +626,7 @@ fn visitFnDecl(c: *Context, fn_decl: *const clang.FunctionDecl) Error!void {...@@ -629,7 +626,7 @@ fn visitFnDecl(c: *Context, fn_decl: *const clang.FunctionDecl) Error!void {
629 },626 },
630 else => break fn_type,627 else => break fn_type,
631 }628 }
632 } else unreachable;629 };
633 const fn_ty = @ptrCast(*const clang.FunctionType, fn_type);630 const fn_ty = @ptrCast(*const clang.FunctionType, fn_type);
634 const return_qt = fn_ty.getReturnType();631 const return_qt = fn_ty.getReturnType();
635632
src/type.zig+4-6
...@@ -1554,10 +1554,10 @@ pub const Type = extern union {...@@ -1554,10 +1554,10 @@ pub const Type = extern union {
1554 ) @TypeOf(writer).Error!void {1554 ) @TypeOf(writer).Error!void {
1555 _ = options;1555 _ = options;
1556 comptime assert(unused_format_string.len == 0);1556 comptime assert(unused_format_string.len == 0);
1557 if (@import("builtin").zig_backend != .stage1) {1557 if (true) {
1558 // This is disabled to work around a stage2 bug where this function recursively1558 // This is disabled to work around a bug where this function
1559 // causes more generic function instantiations resulting in an infinite loop1559 // recursively causes more generic function instantiations
1560 // in the compiler.1560 // resulting in an infinite loop in the compiler.
1561 try writer.writeAll("[TODO fix internal compiler bug regarding dump]");1561 try writer.writeAll("[TODO fix internal compiler bug regarding dump]");
1562 return;1562 return;
1563 }1563 }
...@@ -6551,9 +6551,7 @@ pub const Type = extern union {...@@ -6551,9 +6551,7 @@ pub const Type = extern union {
6551 else => {},6551 else => {},
6552 }6552 }
6553 } else {6553 } else {
6554 // TODO stage1 type inference bug
6555 const T = Type.Tag;6554 const T = Type.Tag;
6556
6557 const type_payload = try arena.create(Type.Payload.ElemType);6555 const type_payload = try arena.create(Type.Payload.ElemType);
6558 type_payload.* = .{6556 type_payload.* = .{
6559 .base = .{6557 .base = .{
src/zig_llvm.h-2
...@@ -337,7 +337,6 @@ ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const...@@ -337,7 +337,6 @@ ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const
337337
338// synchronize with llvm/include/ADT/Triple.h::ArchType338// synchronize with llvm/include/ADT/Triple.h::ArchType
339// synchronize with std.Target.Cpu.Arch339// synchronize with std.Target.Cpu.Arch
340// synchronize with src/stage1/target.cpp::arch_list
341// synchronize with codegen/llvm/bindings.zig::ArchType340// synchronize with codegen/llvm/bindings.zig::ArchType
342enum ZigLLVM_ArchType {341enum ZigLLVM_ArchType {
343 ZigLLVM_UnknownArch,342 ZigLLVM_UnknownArch,
...@@ -428,7 +427,6 @@ enum ZigLLVM_VendorType {...@@ -428,7 +427,6 @@ enum ZigLLVM_VendorType {
428// synchronize with llvm/include/ADT/Triple.h::OsType427// synchronize with llvm/include/ADT/Triple.h::OsType
429// synchronize with std.Target.Os.Tag428// synchronize with std.Target.Os.Tag
430// synchronize with codegen/llvm/bindings.zig::OsType429// synchronize with codegen/llvm/bindings.zig::OsType
431// synchronize with src/stage1/target.cpp::os_list
432enum ZigLLVM_OSType {430enum ZigLLVM_OSType {
433 ZigLLVM_UnknownOS,431 ZigLLVM_UnknownOS,
434432
test/behavior.zig+9-12
...@@ -94,6 +94,8 @@ test {...@@ -94,6 +94,8 @@ test {
94 _ = @import("behavior/bugs/12551.zig");94 _ = @import("behavior/bugs/12551.zig");
95 _ = @import("behavior/bugs/12644.zig");95 _ = @import("behavior/bugs/12644.zig");
96 _ = @import("behavior/bugs/12680.zig");96 _ = @import("behavior/bugs/12680.zig");
97 _ = @import("behavior/bugs/12723.zig");
98 _ = @import("behavior/bugs/12776.zig");
97 _ = @import("behavior/bugs/12786.zig");99 _ = @import("behavior/bugs/12786.zig");
98 _ = @import("behavior/bugs/12794.zig");100 _ = @import("behavior/bugs/12794.zig");
99 _ = @import("behavior/bugs/12801-1.zig");101 _ = @import("behavior/bugs/12801-1.zig");
...@@ -112,8 +114,8 @@ test {...@@ -112,8 +114,8 @@ test {
112 _ = @import("behavior/bugs/13069.zig");114 _ = @import("behavior/bugs/13069.zig");
113 _ = @import("behavior/bugs/13112.zig");115 _ = @import("behavior/bugs/13112.zig");
114 _ = @import("behavior/bugs/13128.zig");116 _ = @import("behavior/bugs/13128.zig");
115 _ = @import("behavior/bugs/13164.zig");
116 _ = @import("behavior/bugs/13159.zig");117 _ = @import("behavior/bugs/13159.zig");
118 _ = @import("behavior/bugs/13164.zig");
117 _ = @import("behavior/bugs/13171.zig");119 _ = @import("behavior/bugs/13171.zig");
118 _ = @import("behavior/bugs/13285.zig");120 _ = @import("behavior/bugs/13285.zig");
119 _ = @import("behavior/bugs/13435.zig");121 _ = @import("behavior/bugs/13435.zig");
...@@ -126,7 +128,9 @@ test {...@@ -126,7 +128,9 @@ test {
126 _ = @import("behavior/cast_int.zig");128 _ = @import("behavior/cast_int.zig");
127 _ = @import("behavior/comptime_memory.zig");129 _ = @import("behavior/comptime_memory.zig");
128 _ = @import("behavior/const_slice_child.zig");130 _ = @import("behavior/const_slice_child.zig");
131 _ = @import("behavior/decltest.zig");
129 _ = @import("behavior/defer.zig");132 _ = @import("behavior/defer.zig");
133 _ = @import("behavior/empty_union.zig");
130 _ = @import("behavior/enum.zig");134 _ = @import("behavior/enum.zig");
131 _ = @import("behavior/error.zig");135 _ = @import("behavior/error.zig");
132 _ = @import("behavior/eval.zig");136 _ = @import("behavior/eval.zig");
...@@ -142,6 +146,7 @@ test {...@@ -142,6 +146,7 @@ test {
142 _ = @import("behavior/if.zig");146 _ = @import("behavior/if.zig");
143 _ = @import("behavior/import.zig");147 _ = @import("behavior/import.zig");
144 _ = @import("behavior/incomplete_struct_param_tld.zig");148 _ = @import("behavior/incomplete_struct_param_tld.zig");
149 _ = @import("behavior/inline_switch.zig");
145 _ = @import("behavior/int128.zig");150 _ = @import("behavior/int128.zig");
146 _ = @import("behavior/int_div.zig");151 _ = @import("behavior/int_div.zig");
147 _ = @import("behavior/inttoptr.zig");152 _ = @import("behavior/inttoptr.zig");
...@@ -154,6 +159,8 @@ test {...@@ -154,6 +159,8 @@ test {
154 _ = @import("behavior/namespace_depends_on_compile_var.zig");159 _ = @import("behavior/namespace_depends_on_compile_var.zig");
155 _ = @import("behavior/null.zig");160 _ = @import("behavior/null.zig");
156 _ = @import("behavior/optional.zig");161 _ = @import("behavior/optional.zig");
162 _ = @import("behavior/packed-struct.zig");
163 _ = @import("behavior/packed_struct_explicit_backing_int.zig");
157 _ = @import("behavior/pointers.zig");164 _ = @import("behavior/pointers.zig");
158 _ = @import("behavior/popcount.zig");165 _ = @import("behavior/popcount.zig");
159 _ = @import("behavior/prefetch.zig");166 _ = @import("behavior/prefetch.zig");
...@@ -169,7 +176,6 @@ test {...@@ -169,7 +176,6 @@ test {
169 _ = @import("behavior/slice_sentinel_comptime.zig");176 _ = @import("behavior/slice_sentinel_comptime.zig");
170 _ = @import("behavior/src.zig");177 _ = @import("behavior/src.zig");
171 _ = @import("behavior/struct.zig");178 _ = @import("behavior/struct.zig");
172 _ = @import("behavior/packed-struct.zig");
173 _ = @import("behavior/struct_contains_null_ptr_itself.zig");179 _ = @import("behavior/struct_contains_null_ptr_itself.zig");
174 _ = @import("behavior/struct_contains_slice_of_itself.zig");180 _ = @import("behavior/struct_contains_slice_of_itself.zig");
175 _ = @import("behavior/switch.zig");181 _ = @import("behavior/switch.zig");
...@@ -180,6 +186,7 @@ test {...@@ -180,6 +186,7 @@ test {
180 _ = @import("behavior/truncate.zig");186 _ = @import("behavior/truncate.zig");
181 _ = @import("behavior/try.zig");187 _ = @import("behavior/try.zig");
182 _ = @import("behavior/tuple.zig");188 _ = @import("behavior/tuple.zig");
189 _ = @import("behavior/tuple_declarations.zig");
183 _ = @import("behavior/type.zig");190 _ = @import("behavior/type.zig");
184 _ = @import("behavior/type_info.zig");191 _ = @import("behavior/type_info.zig");
185 _ = @import("behavior/typename.zig");192 _ = @import("behavior/typename.zig");
...@@ -198,16 +205,6 @@ test {...@@ -198,16 +205,6 @@ test {
198 _ = @import("behavior/wasm.zig");205 _ = @import("behavior/wasm.zig");
199 }206 }
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
211 if (builtin.os.tag != .wasi) {208 if (builtin.os.tag != .wasi) {
212 _ = @import("behavior/asm.zig");209 _ = @import("behavior/asm.zig");
213 }210 }
test/behavior/align.zig+1-15
...@@ -16,7 +16,6 @@ test "global variable alignment" {...@@ -16,7 +16,6 @@ test "global variable alignment" {
16}16}
1717
18test "slicing array of length 1 can not assume runtime index is always zero" {18test "slicing array of length 1 can not assume runtime index is always zero" {
19 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
20 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO19 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
21 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO20 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" {...@@ -61,10 +60,6 @@ test "alignment of struct with pointer has same alignment as usize" {
61}60}
6261
63test "alignment and size of structs with 128-bit fields" {62test "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 }
68 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO63 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
69 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO64 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
7065
...@@ -313,7 +308,6 @@ test "function alignment" {...@@ -313,7 +308,6 @@ test "function alignment" {
313}308}
314309
315test "implicitly decreasing fn alignment" {310test "implicitly decreasing fn alignment" {
316 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
317 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;311 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
318 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;312 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
319313
...@@ -337,7 +331,6 @@ fn alignedBig() align(16) i32 {...@@ -337,7 +331,6 @@ fn alignedBig() align(16) i32 {
337331
338test "@alignCast functions" {332test "@alignCast functions" {
339 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;333 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
340 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
341 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;334 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
342335
343 // function alignment is a compile error on wasm32/wasm64336 // function alignment is a compile error on wasm32/wasm64
...@@ -380,8 +373,6 @@ test "function align expression depends on generic parameter" {...@@ -380,8 +373,6 @@ test "function align expression depends on generic parameter" {
380}373}
381374
382test "function callconv expression depends on generic parameter" {375test "function callconv expression depends on generic parameter" {
383 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
384
385 const S = struct {376 const S = struct {
386 fn doTheTest() !void {377 fn doTheTest() !void {
387 try expect(foobar(.C, 1) == 2);378 try expect(foobar(.C, 1) == 2);
...@@ -435,8 +426,6 @@ fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void {...@@ -435,8 +426,6 @@ fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void {
435}426}
436427
437test "alignment of function with c calling convention" {428test "alignment of function with c calling convention" {
438 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
439
440 var runtime_nothing = &nothing;429 var runtime_nothing = &nothing;
441 const casted1 = @ptrCast(*const u8, runtime_nothing);430 const casted1 = @ptrCast(*const u8, runtime_nothing);
442 const casted2 = @ptrCast(*const fn () callconv(.C) void, casted1);431 const casted2 = @ptrCast(*const fn () callconv(.C) void, casted1);
...@@ -495,7 +484,7 @@ test "struct field explicit alignment" {...@@ -495,7 +484,7 @@ test "struct field explicit alignment" {
495}484}
496485
497test "align(@alignOf(T)) T does not force resolution of T" {486test "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
500 const S = struct {489 const S = struct {
501 const A = struct {490 const A = struct {
...@@ -519,7 +508,6 @@ test "align(@alignOf(T)) T does not force resolution of T" {...@@ -519,7 +508,6 @@ test "align(@alignOf(T)) T does not force resolution of T" {
519}508}
520509
521test "align(N) on functions" {510test "align(N) on functions" {
522 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
523 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO511 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
524 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO512 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO513 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -557,8 +545,6 @@ test "@alignCast null" {...@@ -557,8 +545,6 @@ test "@alignCast null" {
557}545}
558546
559test "alignment of slice element" {547test "alignment of slice element" {
560 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
561
562 const a: []align(1024) const u8 = undefined;548 const a: []align(1024) const u8 = undefined;
563 try expect(@TypeOf(&a[0]) == *align(1024) const u8);549 try expect(@TypeOf(&a[0]) == *align(1024) const u8);
564}550}
test/behavior/array.zig-6
...@@ -102,12 +102,6 @@ test "array len field" {...@@ -102,12 +102,6 @@ test "array len field" {
102}102}
103103
104test "array with sentinels" {104test "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
111 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;105 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
112106
113 const S = struct {107 const S = struct {
test/behavior/async_fn.zig+66-66
...@@ -8,7 +8,7 @@ const expectError = std.testing.expectError;...@@ -8,7 +8,7 @@ const expectError = std.testing.expectError;
8var global_x: i32 = 1;8var global_x: i32 = 1;
99
10test "simple coroutine suspend and resume" {10test "simple coroutine suspend and resume" {
11 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO11 if (true) return error.SkipZigTest; // TODO
12 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO12 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1313
14 var frame = async simpleAsyncFn();14 var frame = async simpleAsyncFn();
...@@ -31,7 +31,7 @@ fn simpleAsyncFn() void {...@@ -31,7 +31,7 @@ fn simpleAsyncFn() void {
31var global_y: i32 = 1;31var global_y: i32 = 1;
3232
33test "pass parameter to coroutine" {33test "pass parameter to coroutine" {
34 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO34 if (true) return error.SkipZigTest; // TODO
35 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO35 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
3636
37 var p = async simpleAsyncFnWithArg(2);37 var p = async simpleAsyncFnWithArg(2);
...@@ -46,7 +46,7 @@ fn simpleAsyncFnWithArg(delta: i32) void {...@@ -46,7 +46,7 @@ fn simpleAsyncFnWithArg(delta: i32) void {
46}46}
4747
48test "suspend at end of function" {48test "suspend at end of function" {
49 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO49 if (true) return error.SkipZigTest; // TODO
50 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO50 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
5151
52 const S = struct {52 const S = struct {
...@@ -68,7 +68,7 @@ test "suspend at end of function" {...@@ -68,7 +68,7 @@ test "suspend at end of function" {
68}68}
6969
70test "local variable in async function" {70test "local variable in async function" {
71 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO71 if (true) return error.SkipZigTest; // TODO
72 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO72 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
7373
74 const S = struct {74 const S = struct {
...@@ -100,7 +100,7 @@ test "local variable in async function" {...@@ -100,7 +100,7 @@ test "local variable in async function" {
100}100}
101101
102test "calling an inferred async function" {102test "calling an inferred async function" {
103 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO103 if (true) return error.SkipZigTest; // TODO
104 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO104 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
105105
106 const S = struct {106 const S = struct {
...@@ -127,7 +127,7 @@ test "calling an inferred async function" {...@@ -127,7 +127,7 @@ test "calling an inferred async function" {
127}127}
128128
129test "@frameSize" {129test "@frameSize" {
130 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO130 if (true) return error.SkipZigTest; // TODO
131 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO131 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
132132
133 if (builtin.target.cpu.arch == .thumb or builtin.target.cpu.arch == .thumbeb)133 if (builtin.target.cpu.arch == .thumb or builtin.target.cpu.arch == .thumbeb)
...@@ -161,7 +161,7 @@ test "@frameSize" {...@@ -161,7 +161,7 @@ test "@frameSize" {
161}161}
162162
163test "coroutine suspend, resume" {163test "coroutine suspend, resume" {
164 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO164 if (true) return error.SkipZigTest; // TODO
165 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO165 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
166166
167 const S = struct {167 const S = struct {
...@@ -205,7 +205,7 @@ test "coroutine suspend, resume" {...@@ -205,7 +205,7 @@ test "coroutine suspend, resume" {
205}205}
206206
207test "coroutine suspend with block" {207test "coroutine suspend with block" {
208 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO208 if (true) return error.SkipZigTest; // TODO
209 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO209 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
210210
211 const p = async testSuspendBlock();211 const p = async testSuspendBlock();
...@@ -234,7 +234,7 @@ var await_a_promise: anyframe = undefined;...@@ -234,7 +234,7 @@ var await_a_promise: anyframe = undefined;
234var await_final_result: i32 = 0;234var await_final_result: i32 = 0;
235235
236test "coroutine await" {236test "coroutine await" {
237 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO237 if (true) return error.SkipZigTest; // TODO
238 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO238 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
239239
240 await_seq('a');240 await_seq('a');
...@@ -274,7 +274,7 @@ fn await_seq(c: u8) void {...@@ -274,7 +274,7 @@ fn await_seq(c: u8) void {
274var early_final_result: i32 = 0;274var early_final_result: i32 = 0;
275275
276test "coroutine await early return" {276test "coroutine await early return" {
277 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO277 if (true) return error.SkipZigTest; // TODO
278 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO278 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
279279
280 early_seq('a');280 early_seq('a');
...@@ -305,7 +305,7 @@ fn early_seq(c: u8) void {...@@ -305,7 +305,7 @@ fn early_seq(c: u8) void {
305}305}
306306
307test "async function with dot syntax" {307test "async function with dot syntax" {
308 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO308 if (true) return error.SkipZigTest; // TODO
309 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO309 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
310310
311 const S = struct {311 const S = struct {
...@@ -321,7 +321,7 @@ test "async function with dot syntax" {...@@ -321,7 +321,7 @@ test "async function with dot syntax" {
321}321}
322322
323test "async fn pointer in a struct field" {323test "async fn pointer in a struct field" {
324 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO324 if (true) return error.SkipZigTest; // TODO
325 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO325 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
326326
327 var data: i32 = 1;327 var data: i32 = 1;
...@@ -349,7 +349,7 @@ fn simpleAsyncFn2(y: *i32) callconv(.Async) void {...@@ -349,7 +349,7 @@ fn simpleAsyncFn2(y: *i32) callconv(.Async) void {
349}349}
350350
351test "@asyncCall with return type" {351test "@asyncCall with return type" {
352 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO352 if (true) return error.SkipZigTest; // TODO
353 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO353 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
354354
355 const Foo = struct {355 const Foo = struct {
...@@ -376,7 +376,7 @@ test "@asyncCall with return type" {...@@ -376,7 +376,7 @@ test "@asyncCall with return type" {
376}376}
377377
378test "async fn with inferred error set" {378test "async fn with inferred error set" {
379 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO379 if (true) return error.SkipZigTest; // TODO
380 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO380 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
381381
382 const S = struct {382 const S = struct {
...@@ -409,7 +409,7 @@ test "async fn with inferred error set" {...@@ -409,7 +409,7 @@ test "async fn with inferred error set" {
409}409}
410410
411test "error return trace across suspend points - early return" {411test "error return trace across suspend points - early return" {
412 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO412 if (true) return error.SkipZigTest; // TODO
413 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO413 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
414414
415 const p = nonFailing();415 const p = nonFailing();
...@@ -419,7 +419,7 @@ test "error return trace across suspend points - early return" {...@@ -419,7 +419,7 @@ test "error return trace across suspend points - early return" {
419}419}
420420
421test "error return trace across suspend points - async return" {421test "error return trace across suspend points - async return" {
422 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO422 if (true) return error.SkipZigTest; // TODO
423 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO423 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
424424
425 const p = nonFailing();425 const p = nonFailing();
...@@ -452,7 +452,7 @@ fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {...@@ -452,7 +452,7 @@ fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {
452}452}
453453
454test "break from suspend" {454test "break from suspend" {
455 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO455 if (true) return error.SkipZigTest; // TODO
456 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO456 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
457457
458 var my_result: i32 = 1;458 var my_result: i32 = 1;
...@@ -470,7 +470,7 @@ fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {...@@ -470,7 +470,7 @@ fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {
470}470}
471471
472test "heap allocated async function frame" {472test "heap allocated async function frame" {
473 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO473 if (true) return error.SkipZigTest; // TODO
474 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO474 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
475475
476 const S = struct {476 const S = struct {
...@@ -497,7 +497,7 @@ test "heap allocated async function frame" {...@@ -497,7 +497,7 @@ test "heap allocated async function frame" {
497}497}
498498
499test "async function call return value" {499test "async function call return value" {
500 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO500 if (true) return error.SkipZigTest; // TODO
501 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO501 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
502502
503 const S = struct {503 const S = struct {
...@@ -541,7 +541,7 @@ test "async function call return value" {...@@ -541,7 +541,7 @@ test "async function call return value" {
541}541}
542542
543test "suspension points inside branching control flow" {543test "suspension points inside branching control flow" {
544 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO544 if (true) return error.SkipZigTest; // TODO
545 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO545 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
546546
547 const S = struct {547 const S = struct {
...@@ -570,7 +570,7 @@ test "suspension points inside branching control flow" {...@@ -570,7 +570,7 @@ test "suspension points inside branching control flow" {
570}570}
571571
572test "call async function which has struct return type" {572test "call async function which has struct return type" {
573 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO573 if (true) return error.SkipZigTest; // TODO
574 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO574 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
575575
576 const S = struct {576 const S = struct {
...@@ -606,7 +606,7 @@ test "call async function which has struct return type" {...@@ -606,7 +606,7 @@ test "call async function which has struct return type" {
606}606}
607607
608test "pass string literal to async function" {608test "pass string literal to async function" {
609 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO609 if (true) return error.SkipZigTest; // TODO
610 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO610 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
611611
612 const S = struct {612 const S = struct {
...@@ -630,7 +630,7 @@ test "pass string literal to async function" {...@@ -630,7 +630,7 @@ test "pass string literal to async function" {
630}630}
631631
632test "await inside an errdefer" {632test "await inside an errdefer" {
633 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO633 if (true) return error.SkipZigTest; // TODO
634 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO634 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
635635
636 const S = struct {636 const S = struct {
...@@ -656,7 +656,7 @@ test "await inside an errdefer" {...@@ -656,7 +656,7 @@ test "await inside an errdefer" {
656}656}
657657
658test "try in an async function with error union and non-zero-bit payload" {658test "try in an async function with error union and non-zero-bit payload" {
659 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO659 if (true) return error.SkipZigTest; // TODO
660 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO660 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
661661
662 const S = struct {662 const S = struct {
...@@ -689,7 +689,7 @@ test "try in an async function with error union and non-zero-bit payload" {...@@ -689,7 +689,7 @@ test "try in an async function with error union and non-zero-bit payload" {
689}689}
690690
691test "returning a const error from async function" {691test "returning a const error from async function" {
692 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO692 if (true) return error.SkipZigTest; // TODO
693 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO693 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
694694
695 const S = struct {695 const S = struct {
...@@ -723,7 +723,7 @@ test "returning a const error from async function" {...@@ -723,7 +723,7 @@ test "returning a const error from async function" {
723}723}
724724
725test "async/await typical usage" {725test "async/await typical usage" {
726 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO726 if (true) return error.SkipZigTest; // TODO
727 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO727 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
728728
729 inline for ([_]bool{ false, true }) |b1| {729 inline for ([_]bool{ false, true }) |b1| {
...@@ -821,7 +821,7 @@ fn testAsyncAwaitTypicalUsage(...@@ -821,7 +821,7 @@ fn testAsyncAwaitTypicalUsage(
821}821}
822822
823test "alignment of local variables in async functions" {823test "alignment of local variables in async functions" {
824 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO824 if (true) return error.SkipZigTest; // TODO
825 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO825 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
826826
827 const S = struct {827 const S = struct {
...@@ -836,7 +836,7 @@ test "alignment of local variables in async functions" {...@@ -836,7 +836,7 @@ test "alignment of local variables in async functions" {
836}836}
837837
838test "no reason to resolve frame still works" {838test "no reason to resolve frame still works" {
839 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO839 if (true) return error.SkipZigTest; // TODO
840 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO840 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
841841
842 _ = async simpleNothing();842 _ = async simpleNothing();
...@@ -847,7 +847,7 @@ fn simpleNothing() void {...@@ -847,7 +847,7 @@ fn simpleNothing() void {
847}847}
848848
849test "async call a generic function" {849test "async call a generic function" {
850 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO850 if (true) return error.SkipZigTest; // TODO
851 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO851 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
852852
853 const S = struct {853 const S = struct {
...@@ -870,7 +870,7 @@ test "async call a generic function" {...@@ -870,7 +870,7 @@ test "async call a generic function" {
870}870}
871871
872test "return from suspend block" {872test "return from suspend block" {
873 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO873 if (true) return error.SkipZigTest; // TODO
874 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO874 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
875875
876 const S = struct {876 const S = struct {
...@@ -887,7 +887,7 @@ test "return from suspend block" {...@@ -887,7 +887,7 @@ test "return from suspend block" {
887}887}
888888
889test "struct parameter to async function is copied to the frame" {889test "struct parameter to async function is copied to the frame" {
890 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO890 if (true) return error.SkipZigTest; // TODO
891 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO891 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
892892
893 const S = struct {893 const S = struct {
...@@ -934,7 +934,7 @@ test "struct parameter to async function is copied to the frame" {...@@ -934,7 +934,7 @@ test "struct parameter to async function is copied to the frame" {
934}934}
935935
936test "cast fn to async fn when it is inferred to be async" {936test "cast fn to async fn when it is inferred to be async" {
937 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO937 if (true) return error.SkipZigTest; // TODO
938 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO938 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
939939
940 const S = struct {940 const S = struct {
...@@ -965,7 +965,7 @@ test "cast fn to async fn when it is inferred to be async" {...@@ -965,7 +965,7 @@ test "cast fn to async fn when it is inferred to be async" {
965}965}
966966
967test "cast fn to async fn when it is inferred to be async, awaited directly" {967test "cast fn to async fn when it is inferred to be async, awaited directly" {
968 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO968 if (true) return error.SkipZigTest; // TODO
969 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO969 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
970970
971 const S = struct {971 const S = struct {
...@@ -995,7 +995,7 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {...@@ -995,7 +995,7 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {
995}995}
996996
997test "await does not force async if callee is blocking" {997test "await does not force async if callee is blocking" {
998 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO998 if (true) return error.SkipZigTest; // TODO
999 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO999 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10001000
1001 const S = struct {1001 const S = struct {
...@@ -1008,7 +1008,7 @@ test "await does not force async if callee is blocking" {...@@ -1008,7 +1008,7 @@ test "await does not force async if callee is blocking" {
1008}1008}
10091009
1010test "recursive async function" {1010test "recursive async function" {
1011 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1011 if (true) return error.SkipZigTest; // TODO
1012 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1012 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10131013
1014 try expect(recursiveAsyncFunctionTest(false).doTheTest() == 55);1014 try expect(recursiveAsyncFunctionTest(false).doTheTest() == 55);
...@@ -1073,7 +1073,7 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type {...@@ -1073,7 +1073,7 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type {
1073}1073}
10741074
1075test "@asyncCall with comptime-known function, but not awaited directly" {1075test "@asyncCall with comptime-known function, but not awaited directly" {
1076 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1076 if (true) return error.SkipZigTest; // TODO
1077 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1077 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
10781078
1079 const S = struct {1079 const S = struct {
...@@ -1105,7 +1105,7 @@ test "@asyncCall with comptime-known function, but not awaited directly" {...@@ -1105,7 +1105,7 @@ test "@asyncCall with comptime-known function, but not awaited directly" {
1105}1105}
11061106
1107test "@asyncCall with actual frame instead of byte buffer" {1107test "@asyncCall with actual frame instead of byte buffer" {
1108 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1108 if (true) return error.SkipZigTest; // TODO
1109 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1109 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11101110
1111 const S = struct {1111 const S = struct {
...@@ -1122,7 +1122,7 @@ test "@asyncCall with actual frame instead of byte buffer" {...@@ -1122,7 +1122,7 @@ test "@asyncCall with actual frame instead of byte buffer" {
1122}1122}
11231123
1124test "@asyncCall using the result location inside the frame" {1124test "@asyncCall using the result location inside the frame" {
1125 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1125 if (true) return error.SkipZigTest; // TODO
1126 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1126 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11271127
1128 const S = struct {1128 const S = struct {
...@@ -1152,7 +1152,7 @@ test "@asyncCall using the result location inside the frame" {...@@ -1152,7 +1152,7 @@ test "@asyncCall using the result location inside the frame" {
1152}1152}
11531153
1154test "@TypeOf an async function call of generic fn with error union type" {1154test "@TypeOf an async function call of generic fn with error union type" {
1155 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1155 if (true) return error.SkipZigTest; // TODO
1156 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1156 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11571157
1158 const S = struct {1158 const S = struct {
...@@ -1166,7 +1166,7 @@ test "@TypeOf an async function call of generic fn with error union type" {...@@ -1166,7 +1166,7 @@ test "@TypeOf an async function call of generic fn with error union type" {
1166}1166}
11671167
1168test "using @TypeOf on a generic function call" {1168test "using @TypeOf on a generic function call" {
1169 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1169 if (true) return error.SkipZigTest; // TODO
1170 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1170 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11711171
1172 const S = struct {1172 const S = struct {
...@@ -1194,7 +1194,7 @@ test "using @TypeOf on a generic function call" {...@@ -1194,7 +1194,7 @@ test "using @TypeOf on a generic function call" {
1194}1194}
11951195
1196test "recursive call of await @asyncCall with struct return type" {1196test "recursive call of await @asyncCall with struct return type" {
1197 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1197 if (true) return error.SkipZigTest; // TODO
1198 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1198 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
11991199
1200 const S = struct {1200 const S = struct {
...@@ -1233,7 +1233,7 @@ test "recursive call of await @asyncCall with struct return type" {...@@ -1233,7 +1233,7 @@ test "recursive call of await @asyncCall with struct return type" {
1233}1233}
12341234
1235test "nosuspend function call" {1235test "nosuspend function call" {
1236 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1236 if (true) return error.SkipZigTest; // TODO
1237 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1237 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12381238
1239 const S = struct {1239 const S = struct {
...@@ -1252,7 +1252,7 @@ test "nosuspend function call" {...@@ -1252,7 +1252,7 @@ test "nosuspend function call" {
1252}1252}
12531253
1254test "await used in expression and awaiting fn with no suspend but async calling convention" {1254test "await used in expression and awaiting fn with no suspend but async calling convention" {
1255 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1255 if (true) return error.SkipZigTest; // TODO
1256 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1256 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12571257
1258 const S = struct {1258 const S = struct {
...@@ -1271,7 +1271,7 @@ test "await used in expression and awaiting fn with no suspend but async calling...@@ -1271,7 +1271,7 @@ test "await used in expression and awaiting fn with no suspend but async calling
1271}1271}
12721272
1273test "await used in expression after a fn call" {1273test "await used in expression after a fn call" {
1274 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1274 if (true) return error.SkipZigTest; // TODO
1275 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1275 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12761276
1277 const S = struct {1277 const S = struct {
...@@ -1292,7 +1292,7 @@ test "await used in expression after a fn call" {...@@ -1292,7 +1292,7 @@ test "await used in expression after a fn call" {
1292}1292}
12931293
1294test "async fn call used in expression after a fn call" {1294test "async fn call used in expression after a fn call" {
1295 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1295 if (true) return error.SkipZigTest; // TODO
1296 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1296 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
12971297
1298 const S = struct {1298 const S = struct {
...@@ -1312,7 +1312,7 @@ test "async fn call used in expression after a fn call" {...@@ -1312,7 +1312,7 @@ test "async fn call used in expression after a fn call" {
1312}1312}
13131313
1314test "suspend in for loop" {1314test "suspend in for loop" {
1315 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1315 if (true) return error.SkipZigTest; // TODO
1316 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1316 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13171317
1318 const S = struct {1318 const S = struct {
...@@ -1341,7 +1341,7 @@ test "suspend in for loop" {...@@ -1341,7 +1341,7 @@ test "suspend in for loop" {
1341}1341}
13421342
1343test "suspend in while loop" {1343test "suspend in while loop" {
1344 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1344 if (true) return error.SkipZigTest; // TODO
1345 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1345 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13461346
1347 const S = struct {1347 const S = struct {
...@@ -1381,7 +1381,7 @@ test "suspend in while loop" {...@@ -1381,7 +1381,7 @@ test "suspend in while loop" {
1381}1381}
13821382
1383test "correctly spill when returning the error union result of another async fn" {1383test "correctly spill when returning the error union result of another async fn" {
1384 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1384 if (true) return error.SkipZigTest; // TODO
1385 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1385 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13861386
1387 const S = struct {1387 const S = struct {
...@@ -1407,7 +1407,7 @@ test "correctly spill when returning the error union result of another async fn"...@@ -1407,7 +1407,7 @@ test "correctly spill when returning the error union result of another async fn"
1407}1407}
14081408
1409test "spill target expr in a for loop" {1409test "spill target expr in a for loop" {
1410 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1410 if (true) return error.SkipZigTest; // TODO
1411 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1411 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14121412
1413 const S = struct {1413 const S = struct {
...@@ -1441,7 +1441,7 @@ test "spill target expr in a for loop" {...@@ -1441,7 +1441,7 @@ test "spill target expr in a for loop" {
1441}1441}
14421442
1443test "spill target expr in a for loop, with a var decl in the loop body" {1443test "spill target expr in a for loop, with a var decl in the loop body" {
1444 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1444 if (true) return error.SkipZigTest; // TODO
1445 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1445 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14461446
1447 const S = struct {1447 const S = struct {
...@@ -1480,7 +1480,7 @@ test "spill target expr in a for loop, with a var decl in the loop body" {...@@ -1480,7 +1480,7 @@ test "spill target expr in a for loop, with a var decl in the loop body" {
1480}1480}
14811481
1482test "async call with @call" {1482test "async call with @call" {
1483 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1483 if (true) return error.SkipZigTest; // TODO
1484 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1484 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
14851485
1486 const S = struct {1486 const S = struct {
...@@ -1505,7 +1505,7 @@ test "async call with @call" {...@@ -1505,7 +1505,7 @@ test "async call with @call" {
1505}1505}
15061506
1507test "async function passed 0-bit arg after non-0-bit arg" {1507test "async function passed 0-bit arg after non-0-bit arg" {
1508 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1508 if (true) return error.SkipZigTest; // TODO
1509 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1509 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15101510
1511 const S = struct {1511 const S = struct {
...@@ -1529,7 +1529,7 @@ test "async function passed 0-bit arg after non-0-bit arg" {...@@ -1529,7 +1529,7 @@ test "async function passed 0-bit arg after non-0-bit arg" {
1529}1529}
15301530
1531test "async function passed align(16) arg after align(8) arg" {1531test "async function passed align(16) arg after align(8) arg" {
1532 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1532 if (true) return error.SkipZigTest; // TODO
1533 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1533 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15341534
1535 const S = struct {1535 const S = struct {
...@@ -1554,7 +1554,7 @@ test "async function passed align(16) arg after align(8) arg" {...@@ -1554,7 +1554,7 @@ test "async function passed align(16) arg after align(8) arg" {
1554}1554}
15551555
1556test "async function call resolves target fn frame, comptime func" {1556test "async function call resolves target fn frame, comptime func" {
1557 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1557 if (true) return error.SkipZigTest; // TODO
1558 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1558 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15591559
1560 const S = struct {1560 const S = struct {
...@@ -1579,7 +1579,7 @@ test "async function call resolves target fn frame, comptime func" {...@@ -1579,7 +1579,7 @@ test "async function call resolves target fn frame, comptime func" {
1579}1579}
15801580
1581test "async function call resolves target fn frame, runtime func" {1581test "async function call resolves target fn frame, runtime func" {
1582 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1582 if (true) return error.SkipZigTest; // TODO
1583 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1583 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
15841584
1585 const S = struct {1585 const S = struct {
...@@ -1605,7 +1605,7 @@ test "async function call resolves target fn frame, runtime func" {...@@ -1605,7 +1605,7 @@ test "async function call resolves target fn frame, runtime func" {
1605}1605}
16061606
1607test "properly spill optional payload capture value" {1607test "properly spill optional payload capture value" {
1608 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1608 if (true) return error.SkipZigTest; // TODO
1609 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1609 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16101610
1611 const S = struct {1611 const S = struct {
...@@ -1632,7 +1632,7 @@ test "properly spill optional payload capture value" {...@@ -1632,7 +1632,7 @@ test "properly spill optional payload capture value" {
1632}1632}
16331633
1634test "handle defer interfering with return value spill" {1634test "handle defer interfering with return value spill" {
1635 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1635 if (true) return error.SkipZigTest; // TODO
1636 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1636 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16371637
1638 const S = struct {1638 const S = struct {
...@@ -1675,7 +1675,7 @@ test "handle defer interfering with return value spill" {...@@ -1675,7 +1675,7 @@ test "handle defer interfering with return value spill" {
1675}1675}
16761676
1677test "take address of temporary async frame" {1677test "take address of temporary async frame" {
1678 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1678 if (true) return error.SkipZigTest; // TODO
1679 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1679 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
16801680
1681 const S = struct {1681 const S = struct {
...@@ -1707,7 +1707,7 @@ test "take address of temporary async frame" {...@@ -1707,7 +1707,7 @@ test "take address of temporary async frame" {
1707}1707}
17081708
1709test "nosuspend await" {1709test "nosuspend await" {
1710 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1710 if (true) return error.SkipZigTest; // TODO
1711 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1711 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17121712
1713 const S = struct {1713 const S = struct {
...@@ -1731,7 +1731,7 @@ test "nosuspend await" {...@@ -1731,7 +1731,7 @@ test "nosuspend await" {
1731}1731}
17321732
1733test "nosuspend on function calls" {1733test "nosuspend on function calls" {
1734 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1734 if (true) return error.SkipZigTest; // TODO
1735 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1735 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17361736
1737 const S0 = struct {1737 const S0 = struct {
...@@ -1750,7 +1750,7 @@ test "nosuspend on function calls" {...@@ -1750,7 +1750,7 @@ test "nosuspend on function calls" {
1750}1750}
17511751
1752test "nosuspend on async function calls" {1752test "nosuspend on async function calls" {
1753 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1753 if (true) return error.SkipZigTest; // TODO
1754 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1754 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17551755
1756 const S0 = struct {1756 const S0 = struct {
...@@ -1771,7 +1771,7 @@ test "nosuspend on async function calls" {...@@ -1771,7 +1771,7 @@ test "nosuspend on async function calls" {
1771}1771}
17721772
1773// test "resume nosuspend async function calls" {1773// test "resume nosuspend async function calls" {
1774// if (builtin.zig_backend != .stage1) return error.SkipZigTest; // if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1774// if (true) return error.SkipZigTest; // if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1775// const S0 = struct {1775// const S0 = struct {
1776// b: i32 = 42,1776// b: i32 = 42,
1777// };1777// };
...@@ -1794,7 +1794,7 @@ test "nosuspend on async function calls" {...@@ -1794,7 +1794,7 @@ test "nosuspend on async function calls" {
1794// }1794// }
17951795
1796test "nosuspend resume async function calls" {1796test "nosuspend resume async function calls" {
1797 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1797 if (true) return error.SkipZigTest; // TODO
1798 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1798 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
17991799
1800 const S0 = struct {1800 const S0 = struct {
...@@ -1819,7 +1819,7 @@ test "nosuspend resume async function calls" {...@@ -1819,7 +1819,7 @@ test "nosuspend resume async function calls" {
1819}1819}
18201820
1821test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {1821test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
1822 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1822 if (true) return error.SkipZigTest; // TODO
1823 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1823 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18241824
1825 const S = struct {1825 const S = struct {
...@@ -1838,7 +1838,7 @@ test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {...@@ -1838,7 +1838,7 @@ test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
1838}1838}
18391839
1840test "@asyncCall with pass-by-value arguments" {1840test "@asyncCall with pass-by-value arguments" {
1841 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1841 if (true) return error.SkipZigTest; // TODO
1842 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1842 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18431843
1844 const F0: u64 = 0xbeefbeefbeefbeef;1844 const F0: u64 = 0xbeefbeefbeefbeef;
...@@ -1874,7 +1874,7 @@ test "@asyncCall with pass-by-value arguments" {...@@ -1874,7 +1874,7 @@ test "@asyncCall with pass-by-value arguments" {
1874}1874}
18751875
1876test "@asyncCall with arguments having non-standard alignment" {1876test "@asyncCall with arguments having non-standard alignment" {
1877 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO1877 if (true) return error.SkipZigTest; // TODO
1878 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO1878 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
18791879
1880 const F0: u64 = 0xbeefbeef;1880 const F0: u64 = 0xbeefbeef;
test/behavior/atomics.zig+3-5
...@@ -151,9 +151,7 @@ test "cmpxchg on a global variable" {...@@ -151,9 +151,7 @@ test "cmpxchg on a global variable" {
151 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO151 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
152 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO152 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
153153
154 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and154 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
155 builtin.cpu.arch == .aarch64)
156 {
157 // https://github.com/ziglang/zig/issues/10627155 // https://github.com/ziglang/zig/issues/10627
158 return error.SkipZigTest;156 return error.SkipZigTest;
159 }157 }
...@@ -220,8 +218,8 @@ test "atomicrmw with floats" {...@@ -220,8 +218,8 @@ test "atomicrmw with floats" {
220 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO218 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
221 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO219 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
222220
223 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm or221 if ((builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) and
224 builtin.zig_backend == .stage2_c) and builtin.cpu.arch == .aarch64)222 builtin.cpu.arch == .aarch64)
225 {223 {
226 // https://github.com/ziglang/zig/issues/10627224 // https://github.com/ziglang/zig/issues/10627
227 return error.SkipZigTest;225 return error.SkipZigTest;
test/behavior/await_struct.zig+1-1
...@@ -10,7 +10,7 @@ var await_a_promise: anyframe = undefined;...@@ -10,7 +10,7 @@ var await_a_promise: anyframe = undefined;
10var await_final_result = Foo{ .x = 0 };10var await_final_result = Foo{ .x = 0 };
1111
12test "coroutine await struct" {12test "coroutine await struct" {
13 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO13 if (true) return error.SkipZigTest; // TODO
1414
15 await_seq('a');15 await_seq('a');
16 var p = async await_amain();16 var p = async await_amain();
test/behavior/basic.zig+1-19
...@@ -198,11 +198,6 @@ const OpaqueA = opaque {};...@@ -198,11 +198,6 @@ const OpaqueA = opaque {};
198const OpaqueB = opaque {};198const OpaqueB = opaque {};
199199
200test "opaque types" {200test "opaque types" {
201 if (builtin.zig_backend == .stage1) {
202 // stage1 gets the type names wrong
203 return error.SkipZigTest;
204 }
205
206 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO201 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
207202
208 try expect(*OpaqueA != *OpaqueB);203 try expect(*OpaqueA != *OpaqueB);
...@@ -290,7 +285,6 @@ fn fB() []const u8 {...@@ -290,7 +285,6 @@ fn fB() []const u8 {
290285
291test "call function pointer in struct" {286test "call function pointer in struct" {
292 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;287 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
293 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
294288
295 try expect(mem.eql(u8, f3(true), "a"));289 try expect(mem.eql(u8, f3(true), "a"));
296 try expect(mem.eql(u8, f3(false), "b"));290 try expect(mem.eql(u8, f3(false), "b"));
...@@ -329,7 +323,6 @@ fn copy(src: *const u64, dst: *u64) void {...@@ -329,7 +323,6 @@ fn copy(src: *const u64, dst: *u64) void {
329}323}
330324
331test "call result of if else expression" {325test "call result of if else expression" {
332 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers
333 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;326 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
334 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;327 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
335 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;328 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -573,22 +566,16 @@ fn emptyFn() void {}...@@ -573,22 +566,16 @@ fn emptyFn() void {}
573566
574const addr1 = @ptrCast(*const u8, &emptyFn);567const addr1 = @ptrCast(*const u8, &emptyFn);
575test "comptime cast fn to ptr" {568test "comptime cast fn to ptr" {
576 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
577
578 const addr2 = @ptrCast(*const u8, &emptyFn);569 const addr2 = @ptrCast(*const u8, &emptyFn);
579 comptime try expect(addr1 == addr2);570 comptime try expect(addr1 == addr2);
580}571}
581572
582test "equality compare fn ptrs" {573test "equality compare fn ptrs" {
583 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
584
585 var a = &emptyFn;574 var a = &emptyFn;
586 try expect(a == a);575 try expect(a == a);
587}576}
588577
589test "self reference through fn ptr field" {578test "self reference through fn ptr field" {
590 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
591
592 const S = struct {579 const S = struct {
593 const A = struct {580 const A = struct {
594 f: *const fn (A) u8,581 f: *const fn (A) u8,
...@@ -783,10 +770,6 @@ test "auto created variables have correct alignment" {...@@ -783,10 +770,6 @@ test "auto created variables have correct alignment" {
783}770}
784771
785test "extern variable with non-pointer opaque type" {772test "extern variable with non-pointer opaque type" {
786 if (builtin.zig_backend == .stage1) {
787 // Regressed with LLVM 14
788 return error.SkipZigTest;
789 }
790 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO773 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
791 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO774 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
792 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO775 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -963,7 +946,7 @@ test "array type comes from generic function" {...@@ -963,7 +946,7 @@ test "array type comes from generic function" {
963}946}
964947
965test "generic function uses return type of other generic function" {948test "generic function uses return type of other generic function" {
966 if (builtin.zig_backend != .stage1) {949 if (true) {
967 // This test has been failing sporadically on the CI.950 // This test has been failing sporadically on the CI.
968 // It's not enough to verify that it works locally; we need to diagnose why951 // It's not enough to verify that it works locally; we need to diagnose why
969 // it fails on the CI sometimes before turning it back on.952 // 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" {...@@ -1067,7 +1050,6 @@ test "inline call of function with a switch inside the return statement" {
1067}1050}
10681051
1069test "namespace lookup ignores decl causing the lookup" {1052test "namespace lookup ignores decl causing the lookup" {
1070 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1071 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO1053 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1072 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1054 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1073 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1055 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" {...@@ -155,10 +155,6 @@ test "bitcast generates a temporary value" {
155}155}
156156
157test "@bitCast packed structs at runtime and comptime" {157test "@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 }
162 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;158 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
163 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;159 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
164 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;160 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -323,7 +319,6 @@ test "@bitCast packed struct of floats" {...@@ -323,7 +319,6 @@ test "@bitCast packed struct of floats" {
323}319}
324320
325test "comptime @bitCast packed struct to int and back" {321test "comptime @bitCast packed struct to int and back" {
326 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
327 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;322 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
328 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;323 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
329 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;324 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -377,8 +372,7 @@ test "comptime bitcast with fields following f80" {...@@ -377,8 +372,7 @@ test "comptime bitcast with fields following f80" {
377}372}
378373
379test "bitcast vector to integer and back" {374test "bitcast vector to integer and back" {
380 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO: https://github.com/ziglang/zig/issues/13220375 if (true) 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
382376
383 const arr: [16]bool = [_]bool{ true, false } ++ [_]bool{true} ** 14;377 const arr: [16]bool = [_]bool{ true, false } ++ [_]bool{true} ** 14;
384 var x = @splat(16, true);378 var x = @splat(16, true);
test/behavior/bitreverse.zig-6
...@@ -5,8 +5,6 @@ const minInt = std.math.minInt;...@@ -5,8 +5,6 @@ const minInt = std.math.minInt;
55
6test "@bitReverse large exotic integer" {6test "@bitReverse large exotic integer" {
7 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;7 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
11 try expect(@bitReverse(@as(u95, 0x123456789abcdef111213141)) == 0x4146424447bd9eac8f351624);9 try expect(@bitReverse(@as(u95, 0x123456789abcdef111213141)) == 0x4146424447bd9eac8f351624);
12}10}
...@@ -96,7 +94,6 @@ fn vector8() !void {...@@ -96,7 +94,6 @@ fn vector8() !void {
96}94}
9795
98test "bitReverse vectors u8" {96test "bitReverse vectors u8" {
99 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
100 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;97 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
101 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;98 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
102 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -115,7 +112,6 @@ fn vector16() !void {...@@ -115,7 +112,6 @@ fn vector16() !void {
115}112}
116113
117test "bitReverse vectors u16" {114test "bitReverse vectors u16" {
118 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
119 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;115 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
120 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
121 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;117 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -134,7 +130,6 @@ fn vector24() !void {...@@ -134,7 +130,6 @@ fn vector24() !void {
134}130}
135131
136test "bitReverse vectors u24" {132test "bitReverse vectors u24" {
137 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
138 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;133 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;134 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
140 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;135 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -153,7 +148,6 @@ fn vector0() !void {...@@ -153,7 +148,6 @@ fn vector0() !void {
153}148}
154149
155test "bitReverse vectors u0" {150test "bitReverse vectors u0" {
156 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
157 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;151 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
158 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;152 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
159153
test/behavior/bugs/10147.zig+1-4
...@@ -1,8 +1,7 @@...@@ -1,8 +1,7 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const std = @import("std");2const std = @import("std");
33
4test "uses correct LLVM builtin" {4test "test calling @clz on both vector and scalar inputs" {
5 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO5 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO6 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
8 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO7 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -11,8 +10,6 @@ test "uses correct LLVM builtin" {...@@ -11,8 +10,6 @@ test "uses correct LLVM builtin" {
1110
12 var x: u32 = 0x1;11 var x: u32 = 0x1;
13 var y: @Vector(4, u32) = [_]u32{ 0x1, 0x1, 0x1, 0x1 };12 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.
16 var a = @clz(x);13 var a = @clz(x);
17 var b = @clz(y);14 var b = @clz(y);
18 try std.testing.expectEqual(@as(u6, 31), a);15 try std.testing.expectEqual(@as(u6, 31), a);
test/behavior/bugs/11159.zig-2
...@@ -8,8 +8,6 @@ test {...@@ -8,8 +8,6 @@ test {
8}8}
99
10test {10test {
11 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
12
13 const S = struct {11 const S = struct {
14 comptime x: i32 = 0,12 comptime x: i32 = 0,
15 comptime y: u32 = 0,13 comptime y: u32 = 0,
test/behavior/bugs/11162.zig+2-3
...@@ -2,9 +2,8 @@ const std = @import("std");...@@ -2,9 +2,8 @@ const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const expect = std.testing.expect;3const expect = std.testing.expect;
44
5test "aggregate initializers should allow initializing comptime fields, verifying equality (stage2 only)" {5test "aggregate initializers should allow initializing comptime fields, verifying equality" {
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO6 if (true) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
87
9 var x: u32 = 15;8 var x: u32 = 15;
10 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });9 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });
test/behavior/bugs/11227.zig-2
...@@ -6,8 +6,6 @@ fn foo() u32 {...@@ -6,8 +6,6 @@ fn foo() u32 {
6}6}
7const bar = foo;7const bar = foo;
8test "pointer to alias behaves same as pointer to function" {8test "pointer to alias behaves same as pointer to function" {
9 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers
10
11 var a = &bar;9 var a = &bar;
12 try std.testing.expect(foo() == a());10 try std.testing.expect(foo() == a());
13}11}
test/behavior/bugs/11816.zig-1
...@@ -3,7 +3,6 @@ const builtin = @import("builtin");...@@ -3,7 +3,6 @@ const builtin = @import("builtin");
33
4test {4test {
5 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO5 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
76
8 var x: u32 = 3;7 var x: u32 = 3;
9 const val: usize = while (true) switch (x) {8 const val: usize = while (true) switch (x) {
test/behavior/bugs/12486.zig-2
...@@ -23,8 +23,6 @@ const ErrStruct = struct {...@@ -23,8 +23,6 @@ const ErrStruct = struct {
23};23};
2424
25test {25test {
26 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
27
28 _ = OptEnum{26 _ = OptEnum{
29 .opt_enum = .{27 .opt_enum = .{
30 .EnumVariant = 1,28 .EnumVariant = 1,
test/behavior/bugs/12723.zig-3
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1const expect = @import("std").testing.expect;1const 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.
6test "Non-exhaustive enum backed by comptime_int" {3test "Non-exhaustive enum backed by comptime_int" {
7 const E = enum(comptime_int) { a, b, c, _ };4 const E = enum(comptime_int) { a, b, c, _ };
8 comptime var e: E = .a;5 comptime var e: E = .a;
test/behavior/bugs/1277.zig-1
...@@ -12,7 +12,6 @@ fn f() i32 {...@@ -12,7 +12,6 @@ fn f() i32 {
12}12}
1313
14test "don't emit an LLVM global for a const function when it's in an optional in a struct" {14test "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
16 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO15 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
17 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO16 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
18 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO17 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 {...@@ -8,7 +8,6 @@ fn capacity_() u64 {
88
9test {9test {
10 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO10 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
11 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1211
13 try std.testing.expect((@This(){}).capacity() == 64);12 try std.testing.expect((@This(){}).capacity() == 64);
14}13}
test/behavior/bugs/12801-2.zig-1
...@@ -14,7 +14,6 @@ const Auto = struct {...@@ -14,7 +14,6 @@ const Auto = struct {
14 }14 }
15};15};
16test {16test {
17 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
18 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO17 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
19 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
20 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO19 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/bugs/12885.zig-2
...@@ -11,8 +11,6 @@ const Foo = @Type(.{...@@ -11,8 +11,6 @@ const Foo = @Type(.{
11 .ErrorSet = &info.args,11 .ErrorSet = &info.args,
12});12});
13test "ErrorSet comptime_field_ptr" {13test "ErrorSet comptime_field_ptr" {
14 if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest;
15
16 try expect(Foo == error{bar});14 try expect(Foo == error{bar});
17}15}
1816
test/behavior/bugs/12891.zig-2
...@@ -7,8 +7,6 @@ test "issue12891" {...@@ -7,8 +7,6 @@ test "issue12891" {
7 try std.testing.expect(i < f);7 try std.testing.expect(i < f);
8}8}
9test "nan" {9test "nan" {
10 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
11
12 const f = comptime std.math.nan(f64);10 const f = comptime std.math.nan(f64);
13 var i: usize = 0;11 var i: usize = 0;
14 try std.testing.expect(!(f < i));12 try std.testing.expect(!(f < i));
test/behavior/bugs/12911.zig-2
...@@ -5,7 +5,5 @@ const Thing = struct {...@@ -5,7 +5,5 @@ const Thing = struct {
5 array: [1]Item,5 array: [1]Item,
6};6};
7test {7test {
8 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
9
10 _ = Thing{ .array = undefined };8 _ = Thing{ .array = undefined };
11}9}
test/behavior/bugs/1310.zig+1-2
...@@ -22,7 +22,6 @@ fn agent_callback(_vm: [*]VM, options: [*]u8) callconv(.C) i32 {...@@ -22,7 +22,6 @@ fn agent_callback(_vm: [*]VM, options: [*]u8) callconv(.C) i32 {
22 return 11;22 return 11;
23}23}
2424
25test "fixed" {25test {
26 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
27 try expect(agent_callback(undefined, undefined) == 11);26 try expect(agent_callback(undefined, undefined) == 11);
28}27}
test/behavior/bugs/2006.zig+1-8
...@@ -9,12 +9,5 @@ test "bug 2006" {...@@ -9,12 +9,5 @@ test "bug 2006" {
9 var a: S = undefined;9 var a: S = undefined;
10 a = S{ .p = undefined };10 a = S{ .p = undefined };
11 try expect(@sizeOf(S) != 0);11 try expect(@sizeOf(S) != 0);
12 if (@import("builtin").zig_backend != .stage1) {12 try expect(@sizeOf(*void) == @sizeOf(*i32));
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 }
20}13}
test/behavior/bugs/3112.zig-1
...@@ -13,7 +13,6 @@ fn prev(p: ?State) void {...@@ -13,7 +13,6 @@ fn prev(p: ?State) void {
1313
14test "zig test crash" {14test "zig test crash" {
15 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;15 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
17 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;16 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
18 var global: State = undefined;17 var global: State = undefined;
19 global.enter = prev;18 global.enter = prev;
test/behavior/bugs/3779.zig-3
...@@ -6,7 +6,6 @@ const tag_name = @tagName(TestEnum.TestEnumValue);...@@ -6,7 +6,6 @@ const tag_name = @tagName(TestEnum.TestEnumValue);
6const ptr_tag_name: [*:0]const u8 = tag_name;6const ptr_tag_name: [*:0]const u8 = tag_name;
77
8test "@tagName() returns a string literal" {8test "@tagName() returns a string literal" {
9 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
10 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO9 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1110
12 try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name));11 try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name));
...@@ -19,7 +18,6 @@ const error_name = @errorName(TestError.TestErrorCode);...@@ -19,7 +18,6 @@ const error_name = @errorName(TestError.TestErrorCode);
19const ptr_error_name: [*:0]const u8 = error_name;18const ptr_error_name: [*:0]const u8 = error_name;
2019
21test "@errorName() returns a string literal" {20test "@errorName() returns a string literal" {
22 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
23 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO21 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2422
25 try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name));23 try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name));
...@@ -32,7 +30,6 @@ const type_name = @typeName(TestType);...@@ -32,7 +30,6 @@ const type_name = @typeName(TestType);
32const ptr_type_name: [*:0]const u8 = type_name;30const ptr_type_name: [*:0]const u8 = type_name;
3331
34test "@typeName() returns a string literal" {32test "@typeName() returns a string literal" {
35 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 gets the type wrong
36 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO33 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
3734
38 try std.testing.expect(*const [type_name.len:0]u8 == @TypeOf(type_name));35 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" {...@@ -8,11 +8,5 @@ test "lazy sizeof comparison with zero" {
8}8}
99
10fn hasNoBits(comptime T: type) bool {10fn hasNoBits(comptime T: type) bool {
11 if (@import("builtin").zig_backend != .stage1) {11 return @sizeOf(T) == @sizeOf(*i32);
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;
18}12}
test/behavior/bugs/920.zig+2-11
...@@ -2,23 +2,14 @@ const builtin = @import("builtin");...@@ -2,23 +2,14 @@ const builtin = @import("builtin");
2const std = @import("std");2const std = @import("std");
3const Random = std.rand.Random;3const 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
14const ZigTable = struct {5const ZigTable = struct {
15 r: f64,6 r: f64,
16 x: [257]f64,7 x: [257]f64,
17 f: [257]f64,8 f: [257]f64,
189
19 pdf: pdfFn,10 pdf: *const fn (f64) f64,
20 is_symmetric: bool,11 is_symmetric: bool,
21 zero_case: zeroCaseFn,12 zero_case: *const fn (*Random, f64) f64,
22};13};
2314
24fn 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 {15fn 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");...@@ -3,7 +3,6 @@ const builtin = @import("builtin");
3const expect = std.testing.expect;3const expect = std.testing.expect;
44
5test "@byteSwap integers" {5test "@byteSwap integers" {
6 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
7 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
8 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;7 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
9 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;8 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -62,7 +61,6 @@ fn vector8() !void {...@@ -62,7 +61,6 @@ fn vector8() !void {
62}61}
6362
64test "@byteSwap vectors u8" {63test "@byteSwap vectors u8" {
65 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
66 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;64 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
67 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;65 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
68 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;66 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -81,7 +79,6 @@ fn vector16() !void {...@@ -81,7 +79,6 @@ fn vector16() !void {
81}79}
8280
83test "@byteSwap vectors u16" {81test "@byteSwap vectors u16" {
84 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
85 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;82 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
86 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;83 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
87 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;84 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -100,7 +97,6 @@ fn vector24() !void {...@@ -100,7 +97,6 @@ fn vector24() !void {
100}97}
10198
102test "@byteSwap vectors u24" {99test "@byteSwap vectors u24" {
103 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
104 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;100 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
105 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;101 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
106 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;102 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
...@@ -119,7 +115,6 @@ fn vector0() !void {...@@ -119,7 +115,6 @@ fn vector0() !void {
119}115}
120116
121test "@byteSwap vectors u0" {117test "@byteSwap vectors u0" {
122 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
123 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;118 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
124 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;119 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
125120
test/behavior/call.zig+4-10
...@@ -45,10 +45,7 @@ test "basic invocations" {...@@ -45,10 +45,7 @@ test "basic invocations" {
45 }45 }
46 {46 {
47 // call of non comptime-known function47 // call of non comptime-known function
48 var alias_foo = switch (builtin.zig_backend) {48 var alias_foo = &foo;
49 .stage1 => foo,
50 else => &foo,
51 };
52 try expect(@call(.{ .modifier = .no_async }, alias_foo, .{}) == 1234);49 try expect(@call(.{ .modifier = .no_async }, alias_foo, .{}) == 1234);
53 try expect(@call(.{ .modifier = .never_tail }, alias_foo, .{}) == 1234);50 try expect(@call(.{ .modifier = .never_tail }, alias_foo, .{}) == 1234);
54 try expect(@call(.{ .modifier = .never_inline }, alias_foo, .{}) == 1234);51 try expect(@call(.{ .modifier = .never_inline }, alias_foo, .{}) == 1234);
...@@ -71,7 +68,9 @@ test "tuple parameters" {...@@ -71,7 +68,9 @@ test "tuple parameters" {
71 try expect(@call(.{}, add, .{ 12, b }) == 46);68 try expect(@call(.{}, add, .{ 12, b }) == 46);
72 try expect(@call(.{}, add, .{ a, b }) == 46);69 try expect(@call(.{}, add, .{ a, b }) == 46);
73 try expect(@call(.{}, add, .{ 12, 34 }) == 46);70 try expect(@call(.{}, add, .{ 12, 34 }) == 46);
74 if (builtin.zig_backend == .stage1) comptime try expect(@call(.{}, add, .{ 12, 34 }) == 46); // TODO71 if (false) {
72 comptime try expect(@call(.{}, add, .{ 12, 34 }) == 46); // TODO
73 }
75 try expect(comptime @call(.{}, add, .{ 12, 34 }) == 46);74 try expect(comptime @call(.{}, add, .{ 12, 34 }) == 46);
76 {75 {
77 const separate_args0 = .{ a, b };76 const separate_args0 = .{ a, b };
...@@ -246,8 +245,6 @@ test "function call with 40 arguments" {...@@ -246,8 +245,6 @@ test "function call with 40 arguments" {
246}245}
247246
248test "arguments to comptime parameters generated in comptime blocks" {247test "arguments to comptime parameters generated in comptime blocks" {
249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
250
251 const S = struct {248 const S = struct {
252 fn fortyTwo() i32 {249 fn fortyTwo() i32 {
253 return 42;250 return 42;
...@@ -261,7 +258,6 @@ test "arguments to comptime parameters generated in comptime blocks" {...@@ -261,7 +258,6 @@ test "arguments to comptime parameters generated in comptime blocks" {
261}258}
262259
263test "forced tail call" {260test "forced tail call" {
264 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
265 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO261 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
266 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO262 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
267 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO263 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
...@@ -294,7 +290,6 @@ test "forced tail call" {...@@ -294,7 +290,6 @@ test "forced tail call" {
294}290}
295291
296test "inline call preserves tail call" {292test "inline call preserves tail call" {
297 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
298 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO293 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
299 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO294 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
300 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO295 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
...@@ -329,7 +324,6 @@ test "inline call preserves tail call" {...@@ -329,7 +324,6 @@ test "inline call preserves tail call" {
329}324}
330325
331test "inline call doesn't re-evaluate non generic struct" {326test "inline call doesn't re-evaluate non generic struct" {
332 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
333 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO327 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
334 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO328 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
335 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO329 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/cast.zig-15
...@@ -113,8 +113,6 @@ test "@intToFloat" {...@@ -113,8 +113,6 @@ test "@intToFloat" {
113}113}
114114
115test "@intToFloat(f80)" {115test "@intToFloat(f80)" {
116 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
117
118 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO116 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
119 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO117 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
120 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO118 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -699,11 +697,6 @@ test "peer type resolution: error set supersets" {...@@ -699,11 +697,6 @@ test "peer type resolution: error set supersets" {
699}697}
700698
701test "peer type resolution: disjoint error sets" {699test "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
707 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO700 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
708 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO701 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
709 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO702 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -733,11 +726,6 @@ test "peer type resolution: disjoint error sets" {...@@ -733,11 +726,6 @@ test "peer type resolution: disjoint error sets" {
733}726}
734727
735test "peer type resolution: error union and error set" {728test "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
741 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO729 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
742 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO730 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
743 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO731 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -1080,7 +1068,6 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void {...@@ -1080,7 +1068,6 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void {
1080}1068}
10811069
1082test "compile time int to ptr of function" {1070test "compile time int to ptr of function" {
1083 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1084 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1071 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
10851072
1086 try foobar(FUNCTION_CONSTANT);1073 try foobar(FUNCTION_CONSTANT);
...@@ -1421,8 +1408,6 @@ test "floatToInt to zero-bit int" {...@@ -1421,8 +1408,6 @@ test "floatToInt to zero-bit int" {
1421}1408}
14221409
1423test "peer type resolution of function pointer and function body" {1410test "peer type resolution of function pointer and function body" {
1424 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1425
1426 const T = fn () u32;1411 const T = fn () u32;
1427 const a: T = undefined;1412 const a: T = undefined;
1428 const b: *const T = undefined;1413 const b: *const T = undefined;
test/behavior/comptime_memory.zig+11-32
...@@ -4,8 +4,6 @@ const testing = @import("std").testing;...@@ -4,8 +4,6 @@ const testing = @import("std").testing;
4const ptr_size = @sizeOf(usize);4const ptr_size = @sizeOf(usize);
55
6test "type pun signed and unsigned as single pointer" {6test "type pun signed and unsigned as single pointer" {
7 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
8
9 comptime {7 comptime {
10 var x: u32 = 0;8 var x: u32 = 0;
11 const y = @ptrCast(*i32, &x);9 const y = @ptrCast(*i32, &x);
...@@ -15,8 +13,6 @@ test "type pun signed and unsigned as single pointer" {...@@ -15,8 +13,6 @@ test "type pun signed and unsigned as single pointer" {
15}13}
1614
17test "type pun signed and unsigned as many pointer" {15test "type pun signed and unsigned as many pointer" {
18 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
19
20 comptime {16 comptime {
21 var x: u32 = 0;17 var x: u32 = 0;
22 const y = @ptrCast([*]i32, &x);18 const y = @ptrCast([*]i32, &x);
...@@ -26,8 +22,6 @@ test "type pun signed and unsigned as many pointer" {...@@ -26,8 +22,6 @@ test "type pun signed and unsigned as many pointer" {
26}22}
2723
28test "type pun signed and unsigned as array pointer" {24test "type pun signed and unsigned as array pointer" {
29 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
30
31 comptime {25 comptime {
32 var x: u32 = 0;26 var x: u32 = 0;
33 const y = @ptrCast(*[1]i32, &x);27 const y = @ptrCast(*[1]i32, &x);
...@@ -37,8 +31,7 @@ test "type pun signed and unsigned as array pointer" {...@@ -37,8 +31,7 @@ test "type pun signed and unsigned as array pointer" {
37}31}
3832
39test "type pun signed and unsigned as offset many pointer" {33test "type pun signed and unsigned as offset many pointer" {
40 if (builtin.zig_backend == .stage1) return error.SkipZigTest;34 if (true) {
41 if (builtin.zig_backend != .stage1) {
42 // TODO https://github.com/ziglang/zig/issues/964635 // TODO https://github.com/ziglang/zig/issues/9646
43 return error.SkipZigTest;36 return error.SkipZigTest;
44 }37 }
...@@ -53,8 +46,7 @@ test "type pun signed and unsigned as offset many pointer" {...@@ -53,8 +46,7 @@ test "type pun signed and unsigned as offset many pointer" {
53}46}
5447
55test "type pun signed and unsigned as array pointer" {48test "type pun signed and unsigned as array pointer" {
56 if (builtin.zig_backend == .stage1) return error.SkipZigTest;49 if (true) {
57 if (builtin.zig_backend != .stage1) {
58 // TODO https://github.com/ziglang/zig/issues/964650 // TODO https://github.com/ziglang/zig/issues/9646
59 return error.SkipZigTest;51 return error.SkipZigTest;
60 }52 }
...@@ -69,8 +61,6 @@ test "type pun signed and unsigned as array pointer" {...@@ -69,8 +61,6 @@ test "type pun signed and unsigned as array pointer" {
69}61}
7062
71test "type pun value and struct" {63test "type pun value and struct" {
72 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
73
74 comptime {64 comptime {
75 const StructOfU32 = extern struct { x: u32 };65 const StructOfU32 = extern struct { x: u32 };
76 var inst: StructOfU32 = .{ .x = 0 };66 var inst: StructOfU32 = .{ .x = 0 };
...@@ -85,7 +75,6 @@ fn bigToNativeEndian(comptime T: type, v: T) T {...@@ -85,7 +75,6 @@ fn bigToNativeEndian(comptime T: type, v: T) T {
85 return if (endian == .Big) v else @byteSwap(v);75 return if (endian == .Big) v else @byteSwap(v);
86}76}
87test "type pun endianness" {77test "type pun endianness" {
88 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
89 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO78 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
9079
91 comptime {80 comptime {
...@@ -179,8 +168,7 @@ fn doTypePunBitsTest(as_bits: *Bits) !void {...@@ -179,8 +168,7 @@ fn doTypePunBitsTest(as_bits: *Bits) !void {
179}168}
180169
181test "type pun bits" {170test "type pun bits" {
182 if (builtin.zig_backend == .stage1) return error.SkipZigTest;171 if (true) {
183 if (builtin.zig_backend != .stage1) {
184 // TODO https://github.com/ziglang/zig/issues/9646172 // TODO https://github.com/ziglang/zig/issues/9646
185 return error.SkipZigTest;173 return error.SkipZigTest;
186 }174 }
...@@ -197,8 +185,7 @@ const imports = struct {...@@ -197,8 +185,7 @@ const imports = struct {
197185
198// Make sure lazy values work on their own, before getting into more complex tests186// Make sure lazy values work on their own, before getting into more complex tests
199test "basic pointer preservation" {187test "basic pointer preservation" {
200 if (builtin.zig_backend == .stage1) return error.SkipZigTest;188 if (true) {
201 if (builtin.zig_backend != .stage1) {
202 // TODO https://github.com/ziglang/zig/issues/9646189 // TODO https://github.com/ziglang/zig/issues/9646
203 return error.SkipZigTest;190 return error.SkipZigTest;
204 }191 }
...@@ -211,8 +198,7 @@ test "basic pointer preservation" {...@@ -211,8 +198,7 @@ test "basic pointer preservation" {
211}198}
212199
213test "byte copy preserves linker value" {200test "byte copy preserves linker value" {
214 if (builtin.zig_backend == .stage1) return error.SkipZigTest;201 if (true) {
215 if (builtin.zig_backend != .stage1) {
216 // TODO https://github.com/ziglang/zig/issues/9646202 // TODO https://github.com/ziglang/zig/issues/9646
217 return error.SkipZigTest;203 return error.SkipZigTest;
218 }204 }
...@@ -235,8 +221,7 @@ test "byte copy preserves linker value" {...@@ -235,8 +221,7 @@ test "byte copy preserves linker value" {
235}221}
236222
237test "unordered byte copy preserves linker value" {223test "unordered byte copy preserves linker value" {
238 if (builtin.zig_backend == .stage1) return error.SkipZigTest;224 if (true) {
239 if (builtin.zig_backend != .stage1) {
240 // TODO https://github.com/ziglang/zig/issues/9646225 // TODO https://github.com/ziglang/zig/issues/9646
241 return error.SkipZigTest;226 return error.SkipZigTest;
242 }227 }
...@@ -260,8 +245,7 @@ test "unordered byte copy preserves linker value" {...@@ -260,8 +245,7 @@ test "unordered byte copy preserves linker value" {
260}245}
261246
262test "shuffle chunks of linker value" {247test "shuffle chunks of linker value" {
263 if (builtin.zig_backend == .stage1) return error.SkipZigTest;248 if (true) {
264 if (builtin.zig_backend != .stage1) {
265 // TODO https://github.com/ziglang/zig/issues/9646249 // TODO https://github.com/ziglang/zig/issues/9646
266 return error.SkipZigTest;250 return error.SkipZigTest;
267 }251 }
...@@ -279,8 +263,7 @@ test "shuffle chunks of linker value" {...@@ -279,8 +263,7 @@ test "shuffle chunks of linker value" {
279}263}
280264
281test "dance on linker values" {265test "dance on linker values" {
282 if (builtin.zig_backend == .stage1) return error.SkipZigTest;266 if (true) {
283 if (builtin.zig_backend != .stage1) {
284 // TODO https://github.com/ziglang/zig/issues/9646267 // TODO https://github.com/ziglang/zig/issues/9646
285 return error.SkipZigTest;268 return error.SkipZigTest;
286 }269 }
...@@ -311,8 +294,7 @@ test "dance on linker values" {...@@ -311,8 +294,7 @@ test "dance on linker values" {
311}294}
312295
313test "offset array ptr by element size" {296test "offset array ptr by element size" {
314 if (builtin.zig_backend == .stage1) return error.SkipZigTest;297 if (true) {
315 if (builtin.zig_backend != .stage1) {
316 // TODO https://github.com/ziglang/zig/issues/9646298 // TODO https://github.com/ziglang/zig/issues/9646
317 return error.SkipZigTest;299 return error.SkipZigTest;
318 }300 }
...@@ -339,8 +321,7 @@ test "offset array ptr by element size" {...@@ -339,8 +321,7 @@ test "offset array ptr by element size" {
339}321}
340322
341test "offset instance by field size" {323test "offset instance by field size" {
342 if (builtin.zig_backend == .stage1) return error.SkipZigTest;324 if (true) {
343 if (builtin.zig_backend != .stage1) {
344 // TODO https://github.com/ziglang/zig/issues/9646325 // TODO https://github.com/ziglang/zig/issues/9646
345 return error.SkipZigTest;326 return error.SkipZigTest;
346 }327 }
...@@ -365,8 +346,7 @@ test "offset instance by field size" {...@@ -365,8 +346,7 @@ test "offset instance by field size" {
365}346}
366347
367test "offset field ptr by enclosing array element size" {348test "offset field ptr by enclosing array element size" {
368 if (builtin.zig_backend == .stage1) return error.SkipZigTest;349 if (true) {
369 if (builtin.zig_backend != .stage1) {
370 // TODO https://github.com/ziglang/zig/issues/9646350 // TODO https://github.com/ziglang/zig/issues/9646
371 return error.SkipZigTest;351 return error.SkipZigTest;
372 }352 }
...@@ -395,7 +375,6 @@ test "offset field ptr by enclosing array element size" {...@@ -395,7 +375,6 @@ test "offset field ptr by enclosing array element size" {
395}375}
396376
397test "accessing reinterpreted memory of parent object" {377test "accessing reinterpreted memory of parent object" {
398 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
399 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
400 const S = extern struct {379 const S = extern struct {
401 a: f32,380 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" {...@@ -151,7 +151,6 @@ test "fn returning empty error set can be passed as fn returning any error" {
151}151}
152152
153test "fn returning empty error set can be passed as fn returning any error - pointer" {153test "fn returning empty error set can be passed as fn returning any error - pointer" {
154 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
155 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO154 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
156 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO155 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
157156
...@@ -465,11 +464,6 @@ test "nested catch" {...@@ -465,11 +464,6 @@ test "nested catch" {
465}464}
466465
467test "function pointer with return type that is error union with payload which is pointer of parent struct" {466test "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
473 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO467 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
474 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO468 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
475469
...@@ -582,9 +576,6 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 {...@@ -582,9 +576,6 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 {
582}576}
583577
584test "error set equality" {578test "error set equality" {
585 // This tests using stage2 logic (#11022)
586 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
587
588 const a = error{One};579 const a = error{One};
589 const b = error{One};580 const b = error{One};
590581
...@@ -752,7 +743,6 @@ const NoReturn = struct {...@@ -752,7 +743,6 @@ const NoReturn = struct {
752};743};
753744
754test "error union of noreturn used with if" {745test "error union of noreturn used with if" {
755 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
756 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO746 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
757 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO747 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
758 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO748 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
...@@ -767,7 +757,6 @@ test "error union of noreturn used with if" {...@@ -767,7 +757,6 @@ test "error union of noreturn used with if" {
767}757}
768758
769test "error union of noreturn used with try" {759test "error union of noreturn used with try" {
770 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
771 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO760 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
772 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO761 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
773 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO762 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
...@@ -779,7 +768,6 @@ test "error union of noreturn used with try" {...@@ -779,7 +768,6 @@ test "error union of noreturn used with try" {
779}768}
780769
781test "error union of noreturn used with catch" {770test "error union of noreturn used with catch" {
782 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
783 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO771 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
784 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO772 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
785 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO773 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
...@@ -807,7 +795,6 @@ test "alignment of wrapping an error union payload" {...@@ -807,7 +795,6 @@ test "alignment of wrapping an error union payload" {
807}795}
808796
809test "compare error union and error set" {797test "compare error union and error set" {
810 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
811 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;798 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
812799
813 var a: anyerror = error.Foo;800 var a: anyerror = error.Foo;
...@@ -857,8 +844,6 @@ test "error from comptime string" {...@@ -857,8 +844,6 @@ test "error from comptime string" {
857}844}
858845
859test "field access of anyerror results in smaller error set" {846test "field access of anyerror results in smaller error set" {
860 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
861
862 const E1 = @TypeOf(error.Foo);847 const E1 = @TypeOf(error.Foo);
863 try expect(@TypeOf(E1.Foo) == E1);848 try expect(@TypeOf(E1.Foo) == E1);
864 const E2 = error{ A, B, C };849 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 {...@@ -606,15 +606,16 @@ fn assertEqualPtrs(ptr1: *const u8, ptr2: *const u8) !void {
606606
607// This one is still up for debate in the language specification.607// This one is still up for debate in the language specification.
608// Application code should not rely on this behavior until it is solidified.608// 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 literals609// Historically, stage1 had 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 if610// but it did not work if the values are constructed with comptime code, or if
611// arrays of non-u8 elements are used instead.611// arrays of non-u8 elements are used instead.
612// The official language specification might not make this guarantee. However, if612// The official language specification might not make this guarantee. However, if
613// it does make this guarantee, it will make it consistently for all types, not613// 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 for614// only string literals. This is why Zig currently has a string table for
615// string literals, to match stage1 and pass this test, however the end-game once615// string literals, to match legacy stage1 behavior and pass this test, however
616// the lang spec issue is settled would be to use a global InternPool for comptime616// the end-game once the lang spec issue is settled would be to use a global
617// memoized objects, making this behavior consistent across all types.617// InternPool for comptime memoized objects, making this behavior consistent
618// across all types.
618test "string literal used as comptime slice is memoized" {619test "string literal used as comptime slice is memoized" {
619 const a = "link";620 const a = "link";
620 const b = "link";621 const b = "link";
...@@ -742,7 +743,6 @@ fn scalar(x: u32) u32 {...@@ -742,7 +743,6 @@ fn scalar(x: u32) u32 {
742}743}
743744
744test "array concatenation peer resolves element types - value" {745test "array concatenation peer resolves element types - value" {
745 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
746 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;746 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
747 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;747 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
748748
...@@ -758,7 +758,6 @@ test "array concatenation peer resolves element types - value" {...@@ -758,7 +758,6 @@ test "array concatenation peer resolves element types - value" {
758}758}
759759
760test "array concatenation peer resolves element types - pointer" {760test "array concatenation peer resolves element types - pointer" {
761 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
762 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;761 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
763 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;762 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
764763
...@@ -774,7 +773,6 @@ test "array concatenation peer resolves element types - pointer" {...@@ -774,7 +773,6 @@ test "array concatenation peer resolves element types - pointer" {
774}773}
775774
776test "array concatenation sets the sentinel - value" {775test "array concatenation sets the sentinel - value" {
777 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
778 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;776 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
779 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;777 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
780 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;778 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -794,7 +792,6 @@ test "array concatenation sets the sentinel - value" {...@@ -794,7 +792,6 @@ test "array concatenation sets the sentinel - value" {
794}792}
795793
796test "array concatenation sets the sentinel - pointer" {794test "array concatenation sets the sentinel - pointer" {
797 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
798 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;795 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
799796
800 var a = [2]u3{ 1, 7 };797 var a = [2]u3{ 1, 7 };
...@@ -811,7 +808,6 @@ test "array concatenation sets the sentinel - pointer" {...@@ -811,7 +808,6 @@ test "array concatenation sets the sentinel - pointer" {
811}808}
812809
813test "array multiplication sets the sentinel - value" {810test "array multiplication sets the sentinel - value" {
814 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
815 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;811 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
816 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;812 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
817 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;813 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -829,7 +825,6 @@ test "array multiplication sets the sentinel - value" {...@@ -829,7 +825,6 @@ test "array multiplication sets the sentinel - value" {
829}825}
830826
831test "array multiplication sets the sentinel - pointer" {827test "array multiplication sets the sentinel - pointer" {
832 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
833 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;828 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
834 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;829 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...@@ -894,8 +889,6 @@ test "const type-annotated local initialized with function call has correct type
894}889}
895890
896test "comptime pointer load through elem_ptr" {891test "comptime pointer load through elem_ptr" {
897 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 fails this test
898
899 const S = struct {892 const S = struct {
900 x: usize,893 x: usize,
901 };894 };
...@@ -1038,7 +1031,6 @@ test "comptime break operand passing through runtime condition converted to runt...@@ -1038,7 +1031,6 @@ test "comptime break operand passing through runtime condition converted to runt
1038}1031}
10391032
1040test "comptime break operand passing through runtime switch converted to runtime break" {1033test "comptime break operand passing through runtime switch converted to runtime break" {
1041 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1042 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1034 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
10431035
1044 const S = struct {1036 const S = struct {
...@@ -1294,8 +1286,6 @@ test "repeated value is correctly expanded" {...@@ -1294,8 +1286,6 @@ test "repeated value is correctly expanded" {
1294}1286}
12951287
1296test "value in if block is comptime-known" {1288test "value in if block is comptime-known" {
1297 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1298
1299 const first = blk: {1289 const first = blk: {
1300 const s = if (false) "a" else "b";1290 const s = if (false) "a" else "b";
1301 break :blk "foo" ++ s;1291 break :blk "foo" ++ s;
...@@ -1330,8 +1320,6 @@ test "lazy value is resolved as slice operand" {...@@ -1330,8 +1320,6 @@ test "lazy value is resolved as slice operand" {
1330}1320}
13311321
1332test "break from inline loop depends on runtime condition" {1322test "break from inline loop depends on runtime condition" {
1333 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1334
1335 const S = struct {1323 const S = struct {
1336 fn foo(a: u8) bool {1324 fn foo(a: u8) bool {
1337 return a == 4;1325 return a == 4;
...@@ -1405,7 +1393,7 @@ test "length of global array is determinable at comptime" {...@@ -1405,7 +1393,7 @@ test "length of global array is determinable at comptime" {
14051393
1406test "continue nested inline for loop" {1394test "continue nested inline for loop" {
1407 // TODO: https://github.com/ziglang/zig/issues/131751395 // TODO: https://github.com/ziglang/zig/issues/13175
1408 if (builtin.zig_backend != .stage1) return error.SkipZigTest;1396 if (true) return error.SkipZigTest;
14091397
1410 var a: u8 = 0;1398 var a: u8 = 0;
1411 loop: inline for ([_]u8{ 1, 2 }) |x| {1399 loop: inline for ([_]u8{ 1, 2 }) |x| {
...@@ -1422,7 +1410,7 @@ test "continue nested inline for loop" {...@@ -1422,7 +1410,7 @@ test "continue nested inline for loop" {
14221410
1423test "continue nested inline for loop in named block expr" {1411test "continue nested inline for loop in named block expr" {
1424 // TODO: https://github.com/ziglang/zig/issues/131751412 // TODO: https://github.com/ziglang/zig/issues/13175
1425 if (builtin.zig_backend != .stage1) return error.SkipZigTest;1413 if (true) return error.SkipZigTest;
14261414
1427 var a: u8 = 0;1415 var a: u8 = 0;
1428 loop: inline for ([_]u8{ 1, 2 }) |x| {1416 loop: inline for ([_]u8{ 1, 2 }) |x| {
test/behavior/floatop.zig+1-15
...@@ -114,7 +114,7 @@ fn testSqrt() !void {...@@ -114,7 +114,7 @@ fn testSqrt() !void {
114 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 1.1)), 1.0488088481701516, epsilon));114 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 1.1)), 1.0488088481701516, epsilon));
115 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 2.0)), 1.4142135623730950, epsilon));115 try expect(math.approxEqAbs(f32, @sqrt(@as(f32, 2.0)), 1.4142135623730950, epsilon));
116116
117 if (builtin.zig_backend == .stage1) {117 if (false) {
118 if (has_f80_rt) {118 if (has_f80_rt) {
119 // TODO https://github.com/ziglang/zig/issues/10875119 // TODO https://github.com/ziglang/zig/issues/10875
120 if (builtin.os.tag != .freebsd) {120 if (builtin.os.tag != .freebsd) {
...@@ -181,10 +181,6 @@ test "more @sqrt f16 tests" {...@@ -181,10 +181,6 @@ test "more @sqrt f16 tests" {
181}181}
182182
183test "@sin" {183test "@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 }
188 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO184 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
189 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO185 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
190 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO186 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -205,7 +201,6 @@ fn testSin() !void {...@@ -205,7 +201,6 @@ fn testSin() !void {
205}201}
206202
207test "@sin with vectors" {203test "@sin with vectors" {
208 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
209 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO204 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
210 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO205 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
211 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO206 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -226,10 +221,6 @@ fn testSinWithVectors() !void {...@@ -226,10 +221,6 @@ fn testSinWithVectors() !void {
226}221}
227222
228test "@cos" {223test "@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 }
233 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO224 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
234 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO225 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
235 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO226 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -250,7 +241,6 @@ fn testCos() !void {...@@ -250,7 +241,6 @@ fn testCos() !void {
250}241}
251242
252test "@cos with vectors" {243test "@cos with vectors" {
253 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
254 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO244 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
255 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO245 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
256 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -781,7 +771,6 @@ test "f128 at compile time is lossy" {...@@ -781,7 +771,6 @@ test "f128 at compile time is lossy" {
781}771}
782772
783test "comptime fixed-width float zero divided by zero produces NaN" {773test "comptime fixed-width float zero divided by zero produces NaN" {
784 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
785 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO774 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
786 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO775 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
787 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO776 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" {...@@ -793,7 +782,6 @@ test "comptime fixed-width float zero divided by zero produces NaN" {
793}782}
794783
795test "comptime fixed-width float non-zero divided by zero produces signed Inf" {784test "comptime fixed-width float non-zero divided by zero produces signed Inf" {
796 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
797 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO785 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
798 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO786 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
799 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO787 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" {...@@ -810,8 +798,6 @@ test "comptime fixed-width float non-zero divided by zero produces signed Inf" {
810}798}
811799
812test "comptime_float zero divided by zero produces zero" {800test "comptime_float zero divided by zero produces zero" {
813 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
814
815 try expect((0.0 / 0.0) == 0.0);801 try expect((0.0 / 0.0) == 0.0);
816}802}
817803
test/behavior/fn.zig-10
...@@ -68,8 +68,6 @@ fn outer(y: u32) *const fn (u32) u32 {...@@ -68,8 +68,6 @@ fn outer(y: u32) *const fn (u32) u32 {
68}68}
6969
70test "return inner function which references comptime variable of outer function" {70test "return inner function which references comptime variable of outer function" {
71 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
72
73 var func = outer(10);71 var func = outer(10);
74 try expect(func(3) == 7);72 try expect(func(3) == 7);
75}73}
...@@ -97,7 +95,6 @@ test "discard the result of a function that returns a struct" {...@@ -97,7 +95,6 @@ test "discard the result of a function that returns a struct" {
97}95}
9896
99test "inline function call that calls optional function pointer, return pointer at callsite interacts correctly with callsite return type" {97test "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;
101 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;98 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
102 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;99 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
103 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;100 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
...@@ -145,7 +142,6 @@ fn fnWithUnreachable() noreturn {...@@ -145,7 +142,6 @@ fn fnWithUnreachable() noreturn {
145}142}
146143
147test "extern struct with stdcallcc fn pointer" {144test "extern struct with stdcallcc fn pointer" {
148 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
149 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;145 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
150 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;146 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
151147
...@@ -293,11 +289,6 @@ fn acceptsString(foo: []u8) void {...@@ -293,11 +289,6 @@ fn acceptsString(foo: []u8) void {
293}289}
294290
295test "function pointers" {291test "function pointers" {
296 if (builtin.zig_backend == .stage1) {
297 // stage1 has wrong semantics for function pointers
298 return error.SkipZigTest;
299 }
300
301 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO292 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
302 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO293 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
303 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO294 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -415,7 +406,6 @@ test "import passed byref to function in return type" {...@@ -415,7 +406,6 @@ test "import passed byref to function in return type" {
415}406}
416407
417test "implicit cast function to function ptr" {408test "implicit cast function to function ptr" {
418 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
419 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO409 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
420 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO410 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
421 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO411 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
test/behavior/generics.zig+2-4
...@@ -21,8 +21,8 @@ test "simple generic fn" {...@@ -21,8 +21,8 @@ test "simple generic fn" {
2121
22 try expect(max(i32, 3, -1) == 3);22 try expect(max(i32, 3, -1) == 3);
23 try expect(max(u8, 1, 100) == 100);23 try expect(max(u8, 1, 100) == 100);
24 if (builtin.zig_backend == .stage1) {24 if (false) {
25 // TODO: stage2 is incorrectly emitting the following:25 // TODO: zig is incorrectly emitting the following:
26 // error: cast of value 1.23e-01 to type 'f32' loses information26 // error: cast of value 1.23e-01 to type 'f32' loses information
27 try expect(max(f32, 0.123, 0.456) == 0.456);27 try expect(max(f32, 0.123, 0.456) == 0.456);
28 }28 }
...@@ -342,8 +342,6 @@ test "generic instantiation of tagged union with only one field" {...@@ -342,8 +342,6 @@ test "generic instantiation of tagged union with only one field" {
342}342}
343343
344test "nested generic function" {344test "nested generic function" {
345 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
346
347 const S = struct {345 const S = struct {
348 fn foo(comptime T: type, callback: *const fn (user_data: T) anyerror!void, data: T) anyerror!void {346 fn foo(comptime T: type, callback: *const fn (user_data: T) anyerror!void, data: T) anyerror!void {
349 try callback(data);347 try callback(data);
test/behavior/int128.zig+2-2
...@@ -29,8 +29,8 @@ test "undefined 128 bit int" {...@@ -29,8 +29,8 @@ test "undefined 128 bit int" {
2929
30 @setRuntimeSafety(true);30 @setRuntimeSafety(true);
3131
32 // TODO implement @setRuntimeSafety in stage232 // TODO implement @setRuntimeSafety
33 if (builtin.zig_backend != .stage1 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {33 if (builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {
34 return error.SkipZigTest;34 return error.SkipZigTest;
35 }35 }
3636
test/behavior/inttoptr.zig-2
...@@ -1,8 +1,6 @@...@@ -1,8 +1,6 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
22
3test "casting integer address to function pointer" {3test "casting integer address to function pointer" {
4 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
5
6 addressToFunction();4 addressToFunction();
7 comptime addressToFunction();5 comptime addressToFunction();
8}6}
test/behavior/math.zig+4-13
...@@ -94,7 +94,6 @@ fn testOneClz(comptime T: type, x: T) u32 {...@@ -94,7 +94,6 @@ fn testOneClz(comptime T: type, x: T) u32 {
94}94}
9595
96test "@clz vectors" {96test "@clz vectors" {
97 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
98 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO98 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
100 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO99 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -156,7 +155,6 @@ fn testOneCtz(comptime T: type, x: T) u32 {...@@ -156,7 +155,6 @@ fn testOneCtz(comptime T: type, x: T) u32 {
156}155}
157156
158test "@ctz vectors" {157test "@ctz vectors" {
159 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
160 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO158 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
161 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO159 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO160 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -971,8 +969,6 @@ test "overflow arithmetic with u0 values" {...@@ -971,8 +969,6 @@ test "overflow arithmetic with u0 values" {
971}969}
972970
973test "allow signed integer division/remainder when values are comptime-known and positive or exact" {971test "allow signed integer division/remainder when values are comptime-known and positive or exact" {
974 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
975
976 try expect(5 / 3 == 1);972 try expect(5 / 3 == 1);
977 try expect(-5 / -3 == 1);973 try expect(-5 / -3 == 1);
978 try expect(-6 / 3 == -2);974 try expect(-6 / 3 == -2);
...@@ -1009,14 +1005,8 @@ test "quad hex float literal parsing accurate" {...@@ -1009,14 +1005,8 @@ test "quad hex float literal parsing accurate" {
1009 try expect(@bitCast(u128, f) == 0x40042eab345678439abcdefea5678234);1005 try expect(@bitCast(u128, f) == 0x40042eab345678439abcdefea5678234);
1010 }1006 }
1011 {1007 {
1012 // TODO: modify stage1/parse_f128.c to use round-to-even1008 var f: f128 = 0x1.edcb34a235253948765432134674fp-1;
1013 if (builtin.zig_backend == .stage1) {1009 try expect(@bitCast(u128, f) == 0x3ffeedcb34a235253948765432134675); // round-to-even
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 }
1020 }1010 }
1021 {1011 {
1022 var f: f128 = 0x1.353e45674d89abacc3a2ebf3ff4ffp-50;1012 var f: f128 = 0x1.353e45674d89abacc3a2ebf3ff4ffp-50;
...@@ -1270,7 +1260,8 @@ test "@sqrt" {...@@ -1270,7 +1260,8 @@ test "@sqrt" {
1270 try testSqrt(f16, 13.0);1260 try testSqrt(f16, 13.0);
1271 comptime try testSqrt(f16, 13.0);1261 comptime try testSqrt(f16, 13.0);
12721262
1273 if (builtin.zig_backend == .stage1) {1263 // TODO: make this pass
1264 if (false) {
1274 const x = 14.0;1265 const x = 14.0;
1275 const y = x * x;1266 const y = x * x;
1276 const z = @sqrt(y);1267 const z = @sqrt(y);
test/behavior/member_func.zig-2
...@@ -27,7 +27,6 @@ const HasFuncs = struct {...@@ -27,7 +27,6 @@ const HasFuncs = struct {
27};27};
2828
29test "standard field calls" {29test "standard field calls" {
30 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
31 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;30 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
32 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;31 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
33 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;32 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
...@@ -71,7 +70,6 @@ test "standard field calls" {...@@ -71,7 +70,6 @@ test "standard field calls" {
71}70}
7271
73test "@field field calls" {72test "@field field calls" {
74 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
75 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;73 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
76 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;74 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
77 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;75 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
test/behavior/muladd.zig-6
...@@ -47,7 +47,6 @@ test "@mulAdd f80" {...@@ -47,7 +47,6 @@ test "@mulAdd f80" {
47 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO47 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
48 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO48 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
49 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO49 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
50 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
51 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .windows) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/1260250 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .windows) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/12602
5251
53 comptime try testMulAdd80();52 comptime try testMulAdd80();
...@@ -91,7 +90,6 @@ fn vector16() !void {...@@ -91,7 +90,6 @@ fn vector16() !void {
91}90}
9291
93test "vector f16" {92test "vector f16" {
94 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
95 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO93 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
96 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO94 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
97 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO95 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -115,7 +113,6 @@ fn vector32() !void {...@@ -115,7 +113,6 @@ fn vector32() !void {
115}113}
116114
117test "vector f32" {115test "vector f32" {
118 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
119 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
120 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO117 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
121 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO118 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -139,7 +136,6 @@ fn vector64() !void {...@@ -139,7 +136,6 @@ fn vector64() !void {
139}136}
140137
141test "vector f64" {138test "vector f64" {
142 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
143 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
144 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO140 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
145 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO141 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -162,7 +158,6 @@ fn vector80() !void {...@@ -162,7 +158,6 @@ fn vector80() !void {
162}158}
163159
164test "vector f80" {160test "vector f80" {
165 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
166 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO161 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
167 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO162 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
168 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO163 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -187,7 +182,6 @@ fn vector128() !void {...@@ -187,7 +182,6 @@ fn vector128() !void {
187}182}
188183
189test "vector f128" {184test "vector f128" {
190 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
191 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO185 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
192 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO186 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
193 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/optional.zig-5
...@@ -377,8 +377,6 @@ const NoReturn = struct {...@@ -377,8 +377,6 @@ const NoReturn = struct {
377};377};
378378
379test "optional of noreturn used with if" {379test "optional of noreturn used with if" {
380 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
381
382 NoReturn.a = 64;380 NoReturn.a = 64;
383 if (NoReturn.loop()) |_| {381 if (NoReturn.loop()) |_| {
384 @compileError("bad");382 @compileError("bad");
...@@ -388,8 +386,6 @@ test "optional of noreturn used with if" {...@@ -388,8 +386,6 @@ test "optional of noreturn used with if" {
388}386}
389387
390test "optional of noreturn used with orelse" {388test "optional of noreturn used with orelse" {
391 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
392
393 NoReturn.a = 64;389 NoReturn.a = 64;
394 const val = NoReturn.testOrelse();390 const val = NoReturn.testOrelse();
395 try expect(val == 123);391 try expect(val == 123);
...@@ -419,7 +415,6 @@ test "alignment of wrapping an optional payload" {...@@ -419,7 +415,6 @@ test "alignment of wrapping an optional payload" {
419}415}
420416
421test "Optional slice size is optimized" {417test "Optional slice size is optimized" {
422 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
423 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;418 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
424 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;419 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
425 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;420 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;...@@ -5,38 +5,7 @@ const expect = std.testing.expect;
5const expectEqual = std.testing.expectEqual;5const expectEqual = std.testing.expectEqual;
6const native_endian = builtin.cpu.arch.endian();6const 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
37test "flags in packed structs" {8test "flags in packed structs" {
38 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
39
40 const Flags1 = packed struct {9 const Flags1 = packed struct {
41 // first 8 bits10 // first 8 bits
42 b0_0: u1,11 b0_0: u1,
...@@ -121,8 +90,6 @@ test "flags in packed structs" {...@@ -121,8 +90,6 @@ test "flags in packed structs" {
121}90}
12291
123test "consistent size of packed structs" {92test "consistent size of packed structs" {
124 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
125
126 const TxData1 = packed struct { data: u8, _23: u23, full: bool = false };93 const TxData1 = packed struct { data: u8, _23: u23, full: bool = false };
127 const TxData2 = packed struct { data: u9, _22: u22, full: bool = false };94 const TxData2 = packed struct { data: u9, _22: u22, full: bool = false };
12895
...@@ -149,7 +116,6 @@ test "consistent size of packed structs" {...@@ -149,7 +116,6 @@ test "consistent size of packed structs" {
149}116}
150117
151test "correct sizeOf and offsets in packed structs" {118test "correct sizeOf and offsets in packed structs" {
152 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
153 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO119 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
154 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO120 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
155 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO121 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -218,7 +184,6 @@ test "correct sizeOf and offsets in packed structs" {...@@ -218,7 +184,6 @@ test "correct sizeOf and offsets in packed structs" {
218}184}
219185
220test "nested packed structs" {186test "nested packed structs" {
221 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
222 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO188 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
224 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO189 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -285,7 +250,6 @@ test "regular in irregular packed struct" {...@@ -285,7 +250,6 @@ test "regular in irregular packed struct" {
285}250}
286251
287test "byte-aligned field pointer offsets" {252test "byte-aligned field pointer offsets" {
288 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
289 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;253 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
290 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;254 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
291 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;255 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -387,7 +351,6 @@ test "byte-aligned field pointer offsets" {...@@ -387,7 +351,6 @@ test "byte-aligned field pointer offsets" {
387}351}
388352
389test "load pointer from packed struct" {353test "load pointer from packed struct" {
390 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
391 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;354 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
392 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;355 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
393 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;356 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
...@@ -571,7 +534,6 @@ test "runtime init of unnamed packed struct type" {...@@ -571,7 +534,6 @@ test "runtime init of unnamed packed struct type" {
571}534}
572535
573test "packed struct passed to callconv(.C) function" {536test "packed struct passed to callconv(.C) function" {
574 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
575 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;537 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
576 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;538 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
577 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;539 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;...@@ -5,7 +5,6 @@ const expectEqual = std.testing.expectEqual;
5const native_endian = builtin.cpu.arch.endian();5const native_endian = builtin.cpu.arch.endian();
66
7test "packed struct explicit backing integer" {7test "packed struct explicit backing integer" {
8 assert(builtin.zig_backend != .stage1);
9 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO8 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
10 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO9 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
11 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO10 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" {...@@ -135,9 +135,6 @@ test "peer type resolution with C pointers" {
135}135}
136136
137test "peer type resolution with C pointer and const pointer" {137test "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
141 var ptr_c: [*c]u8 = undefined;138 var ptr_c: [*c]u8 = undefined;
142 const ptr_const: u8 = undefined;139 const ptr_const: u8 = undefined;
143 try expect(@TypeOf(ptr_c, &ptr_const) == [*c]const u8);140 try expect(@TypeOf(ptr_c, &ptr_const) == [*c]const u8);
test/behavior/popcount.zig-1
...@@ -65,7 +65,6 @@ fn testPopCountIntegers() !void {...@@ -65,7 +65,6 @@ fn testPopCountIntegers() !void {
65}65}
6666
67test "@popCount vectors" {67test "@popCount vectors" {
68 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
69 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO68 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
70 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO69 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
71 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO70 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/ptrcast.zig-7
...@@ -20,7 +20,6 @@ fn testReinterpretBytesAsInteger() !void {...@@ -20,7 +20,6 @@ fn testReinterpretBytesAsInteger() !void {
20}20}
2121
22test "reinterpret an array over multiple elements, with no well-defined layout" {22test "reinterpret an array over multiple elements, with no well-defined layout" {
23 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
24 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO23 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
25 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO24 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO25 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -77,8 +76,6 @@ fn testReinterpretBytesAsExternStruct() !void {...@@ -77,8 +76,6 @@ fn testReinterpretBytesAsExternStruct() !void {
77}76}
7877
79test "reinterpret bytes of an extern struct (with under-aligned fields) into another" {78test "reinterpret bytes of an extern struct (with under-aligned fields) into another" {
80 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
81
82 try testReinterpretExternStructAsExternStruct();79 try testReinterpretExternStructAsExternStruct();
83 comptime try testReinterpretExternStructAsExternStruct();80 comptime try testReinterpretExternStructAsExternStruct();
84}81}
...@@ -101,8 +98,6 @@ fn testReinterpretExternStructAsExternStruct() !void {...@@ -101,8 +98,6 @@ fn testReinterpretExternStructAsExternStruct() !void {
101}98}
10299
103test "reinterpret bytes of an extern struct into another" {100test "reinterpret bytes of an extern struct into another" {
104 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
105
106 try testReinterpretOverAlignedExternStructAsExternStruct();101 try testReinterpretOverAlignedExternStructAsExternStruct();
107 comptime try testReinterpretOverAlignedExternStructAsExternStruct();102 comptime try testReinterpretOverAlignedExternStructAsExternStruct();
108}103}
...@@ -127,7 +122,6 @@ fn testReinterpretOverAlignedExternStructAsExternStruct() !void {...@@ -127,7 +122,6 @@ fn testReinterpretOverAlignedExternStructAsExternStruct() !void {
127}122}
128123
129test "lower reinterpreted comptime field ptr (with under-aligned fields)" {124test "lower reinterpreted comptime field ptr (with under-aligned fields)" {
130 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
131 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO125 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
132 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO126 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
133 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO127 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)" {...@@ -151,7 +145,6 @@ test "lower reinterpreted comptime field ptr (with under-aligned fields)" {
151}145}
152146
153test "lower reinterpreted comptime field ptr" {147test "lower reinterpreted comptime field ptr" {
154 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
155 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO148 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
156 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO149 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
157 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO150 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig-4
...@@ -149,10 +149,6 @@ test "saturating multiplication" {...@@ -149,10 +149,6 @@ test "saturating multiplication" {
149 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO149 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
150 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO150 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 }
156 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {152 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {
157 // https://github.com/ziglang/zig/issues/9660153 // https://github.com/ziglang/zig/issues/9660
158 return error.SkipZigTest;154 return error.SkipZigTest;
test/behavior/select.zig-1
...@@ -32,7 +32,6 @@ fn selectVectors() !void {...@@ -32,7 +32,6 @@ fn selectVectors() !void {
32}32}
3333
34test "@select arrays" {34test "@select arrays" {
35 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // TODO
36 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO35 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
37 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO36 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
38 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO37 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" {...@@ -71,7 +71,7 @@ test "@shuffle bool 2" {
71 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO71 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
72 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO72 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) {
75 // https://github.com/ziglang/zig/issues/324675 // https://github.com/ziglang/zig/issues/3246
76 return error.SkipZigTest;76 return error.SkipZigTest;
77 }77 }
test/behavior/sizeof_and_typeof.zig-53
...@@ -101,52 +101,6 @@ test "@offsetOf" {...@@ -101,52 +101,6 @@ test "@offsetOf" {
101 try expect(@ptrToInt(&a.i) - @ptrToInt(&a) == @offsetOf(A, "i"));101 try expect(@ptrToInt(&a.i) - @ptrToInt(&a) == @offsetOf(A, "i"));
102}102}
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
150test "@bitOffsetOf" {104test "@bitOffsetOf" {
151 // Packed structs have fixed memory layout105 // Packed structs have fixed memory layout
152 try expect(@bitOffsetOf(P, "a") == 0);106 try expect(@bitOffsetOf(P, "a") == 0);
...@@ -211,8 +165,6 @@ test "branching logic inside @TypeOf" {...@@ -211,8 +165,6 @@ test "branching logic inside @TypeOf" {
211}165}
212166
213test "@bitSizeOf" {167test "@bitSizeOf" {
214 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
215
216 try expect(@bitSizeOf(u2) == 2);168 try expect(@bitSizeOf(u2) == 2);
217 try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8);169 try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8);
218 try expect(@bitSizeOf(struct {170 try expect(@bitSizeOf(struct {
...@@ -224,11 +176,6 @@ test "@bitSizeOf" {...@@ -224,11 +176,6 @@ test "@bitSizeOf" {
224}176}
225177
226test "@sizeOf comparison against zero" {178test "@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
232 const S0 = struct {179 const S0 = struct {
233 f: *@This(),180 f: *@This(),
234 };181 };
test/behavior/slice.zig+4-28
...@@ -182,7 +182,6 @@ test "slicing zero length array" {...@@ -182,7 +182,6 @@ test "slicing zero length array" {
182const x = @intToPtr([*]i32, 0x1000)[0..0x500];182const x = @intToPtr([*]i32, 0x1000)[0..0x500];
183const y = x[0x100..];183const y = x[0x100..];
184test "compile time slice of pointer to hard coded address" {184test "compile time slice of pointer to hard coded address" {
185 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
186 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;185 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
187186
188 try expect(@ptrToInt(x) == 0x1000);187 try expect(@ptrToInt(x) == 0x1000);
...@@ -444,10 +443,7 @@ test "slice syntax resulting in pointer-to-array" {...@@ -444,10 +443,7 @@ test "slice syntax resulting in pointer-to-array" {
444 var array: [2]u8 = [2]u8{ 1, 2 };443 var array: [2]u8 = [2]u8{ 1, 2 };
445 var slice: ?[]u8 = &array;444 var slice: ?[]u8 = &array;
446 comptime try expect(@TypeOf(&array, slice) == ?[]u8);445 comptime try expect(@TypeOf(&array, slice) == ?[]u8);
447 if (builtin.zig_backend != .stage1) {446 comptime try expect(@TypeOf(slice, &array) == ?[]u8);
448 // stage1 is not passing this case
449 comptime try expect(@TypeOf(slice, &array) == ?[]u8);
450 }
451 comptime try expect(@TypeOf(slice.?[0..2]) == *[2]u8);447 comptime try expect(@TypeOf(slice.?[0..2]) == *[2]u8);
452 }448 }
453449
...@@ -479,13 +475,7 @@ test "slice pointer-to-array null terminated" {...@@ -479,13 +475,7 @@ test "slice pointer-to-array null terminated" {
479 var slice: [:0]u8 = &array;475 var slice: [:0]u8 = &array;
480 try expect(@TypeOf(slice[1..3]) == *[2]u8);476 try expect(@TypeOf(slice[1..3]) == *[2]u8);
481 try expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);477 try expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
482478 try expect(@TypeOf(slice[1..]) == *[4:0]u8);
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 }
489 }479 }
490480
491 var array = [5:0]u8{ 1, 2, 3, 4, 5 };481 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
...@@ -509,12 +499,7 @@ test "slice pointer-to-array zero length" {...@@ -509,12 +499,7 @@ test "slice pointer-to-array zero length" {
509 var array = [0:0]u8{};499 var array = [0:0]u8{};
510 var src_slice: [:0]u8 = &array;500 var src_slice: [:0]u8 = &array;
511 var slice = src_slice[0..0];501 var slice = src_slice[0..0];
512 if (builtin.zig_backend == .stage1) {502 try expect(@TypeOf(slice) == *[0:0]u8);
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 }
518 }503 }
519 }504 }
520505
...@@ -573,16 +558,11 @@ test "array concat of slices gives ptr to array" {...@@ -573,16 +558,11 @@ test "array concat of slices gives ptr to array" {
573 var b: []const u8 = "asdf";558 var b: []const u8 = "asdf";
574 const c = a ++ b;559 const c = a ++ b;
575 try expect(std.mem.eql(u8, c, "aoeuasdf"));560 try expect(std.mem.eql(u8, c, "aoeuasdf"));
576 if (builtin.zig_backend != .stage1) {561 try expect(@TypeOf(c) == *const [8]u8);
577 // spec change: array concat now returns pointer-to-array for slices
578 try expect(@TypeOf(c) == *const [8]u8);
579 }
580 }562 }
581}563}
582564
583test "array mult of slice gives ptr to array" {565test "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
586 comptime {566 comptime {
587 var a: []const u8 = "aoeu";567 var a: []const u8 = "aoeu";
588 const c = a ** 2;568 const c = a ** 2;
...@@ -626,8 +606,6 @@ test "slice sentinel access at comptime" {...@@ -626,8 +606,6 @@ test "slice sentinel access at comptime" {
626}606}
627607
628test "slicing array with sentinel as end index" {608test "slicing array with sentinel as end index" {
629 // Doesn't work in stage1
630 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
631 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;609 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
632610
633 const S = struct {611 const S = struct {
...@@ -645,8 +623,6 @@ test "slicing array with sentinel as end index" {...@@ -645,8 +623,6 @@ test "slicing array with sentinel as end index" {
645}623}
646624
647test "slicing slice with sentinel as end index" {625test "slicing slice with sentinel as end index" {
648 // Doesn't work in stage1
649 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
650 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;626 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
651627
652 const S = struct {628 const S = struct {
test/behavior/struct.zig+2-40
...@@ -419,11 +419,8 @@ test "packed struct 24bits" {...@@ -419,11 +419,8 @@ test "packed struct 24bits" {
419 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO419 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
420420
421 comptime {421 comptime {
422 // stage1 gets the wrong answer for sizeof422 std.debug.assert(@sizeOf(Foo24Bits) == @sizeOf(u24));
423 if (builtin.zig_backend != .stage1) {423 std.debug.assert(@sizeOf(Foo96Bits) == @sizeOf(u96));
424 std.debug.assert(@sizeOf(Foo24Bits) == @sizeOf(u24));
425 std.debug.assert(@sizeOf(Foo96Bits) == @sizeOf(u96));
426 }
427 }424 }
428425
429 var value = Foo96Bits{426 var value = Foo96Bits{
...@@ -497,10 +494,6 @@ const Bitfields = packed struct {...@@ -497,10 +494,6 @@ const Bitfields = packed struct {
497};494};
498495
499test "packed struct fields are ordered from LSB to MSB" {496test "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 }
504 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO497 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
505 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO498 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
506 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO499 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -640,7 +633,6 @@ test "default struct initialization fields" {...@@ -640,7 +633,6 @@ test "default struct initialization fields" {
640}633}
641634
642test "packed array 24bits" {635test "packed array 24bits" {
643 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
644 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;636 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
645 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;637 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
646 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;638 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
...@@ -698,25 +690,6 @@ const FooArray24Bits = packed struct {...@@ -698,25 +690,6 @@ const FooArray24Bits = packed struct {
698 c: u16,690 c: u16,
699};691};
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
720const FooStructAligned = packed struct {693const FooStructAligned = packed struct {
721 a: u8,694 a: u8,
722 b: u8,695 b: u8,
...@@ -1150,7 +1123,6 @@ test "for loop over pointers to struct, getting field from struct pointer" {...@@ -1150,7 +1123,6 @@ test "for loop over pointers to struct, getting field from struct pointer" {
1150}1123}
11511124
1152test "anon init through error unions and optionals" {1125test "anon init through error unions and optionals" {
1153 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1154 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1126 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1155 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1127 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1156 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1128 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -1178,7 +1150,6 @@ test "anon init through error unions and optionals" {...@@ -1178,7 +1150,6 @@ test "anon init through error unions and optionals" {
1178}1150}
11791151
1180test "anon init through optional" {1152test "anon init through optional" {
1181 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1182 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1153 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1183 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1154 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1184 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1155 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -1199,7 +1170,6 @@ test "anon init through optional" {...@@ -1199,7 +1170,6 @@ test "anon init through optional" {
1199}1170}
12001171
1201test "anon init through error union" {1172test "anon init through error union" {
1202 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1203 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1173 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1204 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1174 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1205 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1175 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -1220,7 +1190,6 @@ test "anon init through error union" {...@@ -1220,7 +1190,6 @@ test "anon init through error union" {
1220}1190}
12211191
1222test "typed init through error unions and optionals" {1192test "typed init through error unions and optionals" {
1223 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1224 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1193 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1225 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1226 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1195 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -1283,10 +1252,6 @@ test "loading a struct pointer perfoms a copy" {...@@ -1283,10 +1252,6 @@ test "loading a struct pointer perfoms a copy" {
1283}1252}
12841253
1285test "packed struct aggregate init" {1254test "packed struct aggregate init" {
1286 if (builtin.zig_backend == .stage1) {
1287 // stage1 fails this test on mips
1288 return error.SkipZigTest;
1289 }
1290 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1255 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1291 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1256 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1292 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1257 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -1328,8 +1293,6 @@ test "packed struct field access via pointer" {...@@ -1328,8 +1293,6 @@ test "packed struct field access via pointer" {
1328}1293}
13291294
1330test "store to comptime field" {1295test "store to comptime field" {
1331 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1332
1333 {1296 {
1334 const S = struct {1297 const S = struct {
1335 comptime a: [2]u32 = [2]u32{ 1, 2 },1298 comptime a: [2]u32 = [2]u32{ 1, 2 },
...@@ -1364,7 +1327,6 @@ test "struct field init value is size of the struct" {...@@ -1364,7 +1327,6 @@ test "struct field init value is size of the struct" {
1364}1327}
13651328
1366test "under-aligned struct field" {1329test "under-aligned struct field" {
1367 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1368 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO1330 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
1369 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1331 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1370 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1332 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
test/behavior/truncate.zig-5
...@@ -60,11 +60,6 @@ test "truncate on comptime integer" {...@@ -60,11 +60,6 @@ test "truncate on comptime integer" {
60}60}
6161
62test "truncate on vectors" {62test "truncate on vectors" {
63 if (builtin.zig_backend == .stage1) {
64 // stage1 fails the comptime test
65 return error.SkipZigTest;
66 }
67
68 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;63 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
69 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;64 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
70 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;65 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/type.zig+2-11
...@@ -229,7 +229,7 @@ test "Type.Vector" {...@@ -229,7 +229,7 @@ test "Type.Vector" {
229}229}
230230
231test "Type.AnyFrame" {231test "Type.AnyFrame" {
232 if (builtin.zig_backend != .stage1) {232 if (true) {
233 // https://github.com/ziglang/zig/issues/6025233 // https://github.com/ziglang/zig/issues/6025
234 return error.SkipZigTest;234 return error.SkipZigTest;
235 }235 }
...@@ -246,8 +246,6 @@ fn add(a: i32, b: i32) i32 {...@@ -246,8 +246,6 @@ fn add(a: i32, b: i32) i32 {
246}246}
247247
248test "Type.ErrorSet" {248test "Type.ErrorSet" {
249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
250
251 try testing.expect(@Type(.{ .ErrorSet = null }) == anyerror);249 try testing.expect(@Type(.{ .ErrorSet = null }) == anyerror);
252250
253 // error sets don't compare equal so just check if they compile251 // error sets don't compare equal so just check if they compile
...@@ -369,12 +367,7 @@ test "Type.Enum" {...@@ -369,12 +367,7 @@ test "Type.Enum" {
369 try testing.expectEqual(@as(u8, 5), @enumToInt(Foo.b));367 try testing.expectEqual(@as(u8, 5), @enumToInt(Foo.b));
370 const Bar = @Type(.{368 const Bar = @Type(.{
371 .Enum = .{369 .Enum = .{
372 // stage2 only has auto layouts370 .layout = .Auto,
373 .layout = if (builtin.zig_backend == .stage1)
374 .Extern
375 else
376 .Auto,
377
378 .tag_type = u32,371 .tag_type = u32,
379 .fields = &.{372 .fields = &.{
380 .{ .name = "a", .value = 1 },373 .{ .name = "a", .value = 1 },
...@@ -501,8 +494,6 @@ test "Type.Union from regular enum" {...@@ -501,8 +494,6 @@ test "Type.Union from regular enum" {
501}494}
502495
503test "Type.Fn" {496test "Type.Fn" {
504 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
505
506 if (true) {497 if (true) {
507 // https://github.com/ziglang/zig/issues/12360498 // https://github.com/ziglang/zig/issues/12360
508 return error.SkipZigTest;499 return error.SkipZigTest;
test/behavior/type_info.zig+17-26
...@@ -201,9 +201,6 @@ test "type info: error set single value" {...@@ -201,9 +201,6 @@ test "type info: error set single value" {
201}201}
202202
203test "type info: error set merged" {203test "type info: error set merged" {
204 // #11022 forces ordering of error sets in stage2
205 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
206
207 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;204 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
208 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO205 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
209 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO206 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -305,8 +302,6 @@ const TestStruct = struct {...@@ -305,8 +302,6 @@ const TestStruct = struct {
305};302};
306303
307test "type info: packed struct info" {304test "type info: packed struct info" {
308 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
309
310 try testPackedStruct();305 try testPackedStruct();
311 comptime try testPackedStruct();306 comptime try testPackedStruct();
312}307}
...@@ -376,25 +371,21 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.C) usize;...@@ -376,25 +371,21 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.C) usize;
376extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.C) usize;371extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.C) usize;
377372
378test "type info: generic function types" {373test "type info: generic function types" {
379 if (builtin.zig_backend != .stage1) {374 const G1 = @typeInfo(@TypeOf(generic1));
380 // stage1 marks all args/return types as null if the function375 try expect(G1.Fn.args.len == 1);
381 // is generic at all. stage2 is more specific.376 try expect(G1.Fn.args[0].is_generic == true);
382 const G1 = @typeInfo(@TypeOf(generic1));377 try expect(G1.Fn.args[0].arg_type == null);
383 try expect(G1.Fn.args.len == 1);378 try expect(G1.Fn.return_type == void);
384 try expect(G1.Fn.args[0].is_generic == true);379
385 try expect(G1.Fn.args[0].arg_type == null);380 const G2 = @typeInfo(@TypeOf(generic2));
386 try expect(G1.Fn.return_type == void);381 try expect(G2.Fn.args.len == 3);
387382 try expect(G2.Fn.args[0].is_generic == false);
388 const G2 = @typeInfo(@TypeOf(generic2));383 try expect(G2.Fn.args[0].arg_type == type);
389 try expect(G2.Fn.args.len == 3);384 try expect(G2.Fn.args[1].is_generic == true);
390 try expect(G2.Fn.args[0].is_generic == false);385 try expect(G2.Fn.args[1].arg_type == null);
391 try expect(G2.Fn.args[0].arg_type == type);386 try expect(G2.Fn.args[2].is_generic == false);
392 try expect(G2.Fn.args[1].is_generic == true);387 try expect(G2.Fn.args[2].arg_type == u8);
393 try expect(G2.Fn.args[1].arg_type == null);388 try expect(G2.Fn.return_type == void);
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 }
398389
399 const G3 = @typeInfo(@TypeOf(generic3));390 const G3 = @typeInfo(@TypeOf(generic3));
400 try expect(G3.Fn.args.len == 1);391 try expect(G3.Fn.args.len == 1);
...@@ -442,7 +433,7 @@ fn testVector() !void {...@@ -442,7 +433,7 @@ fn testVector() !void {
442}433}
443434
444test "type info: anyframe and anyframe->T" {435test "type info: anyframe and anyframe->T" {
445 if (builtin.zig_backend != .stage1) {436 if (true) {
446 // https://github.com/ziglang/zig/issues/6025437 // https://github.com/ziglang/zig/issues/6025
447 return error.SkipZigTest;438 return error.SkipZigTest;
448 }439 }
...@@ -501,7 +492,7 @@ fn add(a: i32, b: i32) i32 {...@@ -501,7 +492,7 @@ fn add(a: i32, b: i32) i32 {
501}492}
502493
503test "type info for async frames" {494test "type info for async frames" {
504 if (builtin.zig_backend != .stage1) {495 if (true) {
505 // https://github.com/ziglang/zig/issues/6025496 // https://github.com/ziglang/zig/issues/6025
506 return error.SkipZigTest;497 return error.SkipZigTest;
507 }498 }
test/behavior/typename.zig-29
...@@ -12,12 +12,6 @@ const expectStringStartsWith = std.testing.expectStringStartsWith;...@@ -12,12 +12,6 @@ const expectStringStartsWith = std.testing.expectStringStartsWith;
12// failures.12// failures.
1313
14test "anon fn param" {14test "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
21 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO15 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO16 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
23 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO17 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -43,12 +37,6 @@ test "anon fn param" {...@@ -43,12 +37,6 @@ test "anon fn param" {
43}37}
4438
45test "anon field init" {39test "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
52 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO40 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
53 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO41 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
54 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO42 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -84,11 +72,6 @@ test "basic" {...@@ -84,11 +72,6 @@ test "basic" {
84}72}
8573
86test "top level decl" {74test "top level decl" {
87 if (builtin.zig_backend == .stage1) {
88 // stage1 fails to return fully qualified namespaces.
89 return error.SkipZigTest;
90 }
91
92 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO75 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
93 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO76 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
94 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO77 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -208,11 +191,6 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8)...@@ -208,11 +191,6 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8)
208}191}
209192
210test "local variable" {193test "local variable" {
211 if (builtin.zig_backend == .stage1) {
212 // stage1 fails to return fully qualified namespaces.
213 return error.SkipZigTest;
214 }
215
216 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO194 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
217 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO195 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
218 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO196 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -231,7 +209,6 @@ test "local variable" {...@@ -231,7 +209,6 @@ test "local variable" {
231}209}
232210
233test "comptime parameters not converted to anytype in function type" {211test "comptime parameters not converted to anytype in function type" {
234 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
235 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO212 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
236 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO213 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
237 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO214 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -241,12 +218,6 @@ test "comptime parameters not converted to anytype in function type" {...@@ -241,12 +218,6 @@ test "comptime parameters not converted to anytype in function type" {
241}218}
242219
243test "anon name strategy used in sub expression" {220test "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
250 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
251 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO222 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
252 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO223 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" {...@@ -76,10 +76,6 @@ test "assign undefined to struct with method" {
76}76}
7777
78test "type name of undefined" {78test "type name of undefined" {
79 if (builtin.zig_backend == .stage1) {
80 // stage1 gets the type name wrong
81 return error.SkipZigTest;
82 }
83 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;79 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
8480
85 const x = undefined;81 const x = undefined;
test/behavior/union.zig-5
...@@ -221,7 +221,6 @@ test "packed union generates correctly aligned type" {...@@ -221,7 +221,6 @@ test "packed union generates correctly aligned type" {
221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
222 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;222 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
224 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
225224
226 const U = packed union {225 const U = packed union {
227 f1: *const fn () error{TestUnexpectedResult}!void,226 f1: *const fn () error{TestUnexpectedResult}!void,
...@@ -1002,7 +1001,6 @@ test "cast from pointer to anonymous struct to pointer to union" {...@@ -1002,7 +1001,6 @@ test "cast from pointer to anonymous struct to pointer to union" {
1002}1001}
10031002
1004test "switching on non exhaustive union" {1003test "switching on non exhaustive union" {
1005 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1006 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1004 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1007 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1005 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" {...@@ -1197,7 +1195,6 @@ test "union tag is set when initiated as a temporary value at runtime" {
1197}1195}
11981196
1199test "extern union most-aligned field is smaller" {1197test "extern union most-aligned field is smaller" {
1200 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1201 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1198 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1202 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1199 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1203 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1200 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -1246,7 +1243,6 @@ test "return an extern union from C calling convention" {...@@ -1246,7 +1243,6 @@ test "return an extern union from C calling convention" {
1246}1243}
12471244
1248test "noreturn field in union" {1245test "noreturn field in union" {
1249 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1250 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1246 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1251 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1247 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1252 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1248 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -1298,7 +1294,6 @@ test "noreturn field in union" {...@@ -1298,7 +1294,6 @@ test "noreturn field in union" {
1298}1294}
12991295
1300test "union and enum field order doesn't match" {1296test "union and enum field order doesn't match" {
1301 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
1302 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1297 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1303 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1298 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;...@@ -6,12 +6,6 @@ const expect = std.testing.expect;
6const expectEqual = std.testing.expectEqual;6const expectEqual = std.testing.expectEqual;
77
8test "implicit cast vector to array - bool" {8test "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
15 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO9 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
16 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO10 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
17 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO11 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -180,9 +174,7 @@ test "tuple to vector" {...@@ -180,9 +174,7 @@ test "tuple to vector" {
180 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO174 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
181 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO175 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
182176
183 if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and177 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
184 builtin.cpu.arch == .aarch64)
185 {
186 // Regressed with LLVM 14:178 // Regressed with LLVM 14:
187 // https://github.com/ziglang/zig/issues/12012179 // https://github.com/ziglang/zig/issues/12012
188 return error.SkipZigTest;180 return error.SkipZigTest;
...@@ -197,9 +189,7 @@ test "tuple to vector" {...@@ -197,9 +189,7 @@ test "tuple to vector" {
197 }189 }
198190
199 try std.testing.expectEqual(v, Vec3{ 1, 1, 1 });191 try std.testing.expectEqual(v, Vec3{ 1, 1, 1 });
200 if (builtin.zig_backend != .stage1) {192 try std.testing.expectEqual(v, .{ 1, 1, 1 });
201 try std.testing.expectEqual(v, .{ 1, 1, 1 });
202 }
203 }193 }
204 };194 };
205 try S.doTheTest();195 try S.doTheTest();
...@@ -406,12 +396,6 @@ test "initialize vector which is a struct field" {...@@ -406,12 +396,6 @@ test "initialize vector which is a struct field" {
406}396}
407397
408test "vector comparison operators" {398test "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
415 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO399 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
416 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO400 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
417 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO401 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
...@@ -801,7 +785,6 @@ test "vector reduce operation" {...@@ -801,7 +785,6 @@ test "vector reduce operation" {
801}785}
802786
803test "vector @reduce comptime" {787test "vector @reduce comptime" {
804 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
805 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO788 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
806 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO789 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
807 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO790 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -937,10 +920,6 @@ test "saturating shift-left" {...@@ -937,10 +920,6 @@ test "saturating shift-left" {
937}920}
938921
939test "multiplication-assignment operator with an array operand" {922test "multiplication-assignment operator with an array operand" {
940 if (builtin.zig_backend == .stage1) {
941 // stage1 emits a compile error
942 return error.SkipZigTest;
943 }
944 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO923 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
945 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO924 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
946 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO925 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -961,10 +940,6 @@ test "multiplication-assignment operator with an array operand" {...@@ -961,10 +940,6 @@ test "multiplication-assignment operator with an array operand" {
961}940}
962941
963test "@addWithOverflow" {942test "@addWithOverflow" {
964 if (builtin.zig_backend == .stage1) {
965 // stage1 doesn't support vector args
966 return error.SkipZigTest;
967 }
968 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO943 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
969 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO944 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
970 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO945 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -1011,10 +986,6 @@ test "@addWithOverflow" {...@@ -1011,10 +986,6 @@ test "@addWithOverflow" {
1011}986}
1012987
1013test "@subWithOverflow" {988test "@subWithOverflow" {
1014 if (builtin.zig_backend == .stage1) {
1015 // stage1 doesn't support vector args
1016 return error.SkipZigTest;
1017 }
1018 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO989 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1019 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO990 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1020 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO991 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -1045,10 +1016,6 @@ test "@subWithOverflow" {...@@ -1045,10 +1016,6 @@ test "@subWithOverflow" {
1045}1016}
10461017
1047test "@mulWithOverflow" {1018test "@mulWithOverflow" {
1048 if (builtin.zig_backend == .stage1) {
1049 // stage1 doesn't support vector args
1050 return error.SkipZigTest;
1051 }
1052 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO1019 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1053 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1020 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
1054 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1021 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
...@@ -1069,10 +1036,6 @@ test "@mulWithOverflow" {...@@ -1069,10 +1036,6 @@ test "@mulWithOverflow" {
1069}1036}
10701037
1071test "@shlWithOverflow" {1038test "@shlWithOverflow" {
1072 if (builtin.zig_backend == .stage1) {
1073 // stage1 doesn't support vector args
1074 return error.SkipZigTest;
1075 }
1076 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO1039 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
1077 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO1040 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
1078 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO1041 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" {...@@ -364,3 +364,10 @@ test "try terminating an infinite loop" {
364 _ = try Foo.bar();364 _ = try Foo.bar();
365 } else unreachable);365 } else unreachable);
366}366}
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}