| author | |
| committer | |
| log | 683ace74724e5818bd01d8a6abb03f5991c4e27b |
| tree | 7bbab80962a17ee006ba11aa6281b10190422d31 |
| parent | d8fc8d0118a6ae99c0298d584faf1d8b5c6712c4 |
| parent | 6279a1d684193ffbe34b384250cdbb5ab4a328f9 |
3 files changed, 10 insertions(+), 4 deletions(-)
lib/std/fmt.zig+2-2| ... | @@ -2124,11 +2124,11 @@ test "pointer" { | ... | @@ -2124,11 +2124,11 @@ test "pointer" { |
| 2124 | try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value}); | 2124 | try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value}); |
| 2125 | } | 2125 | } |
| 2126 | { | 2126 | { |
| 2127 | const value = @intToPtr(*const fn () void, 0xdeadbeef); | 2127 | const value = @intToPtr(*align(1) const fn () void, 0xdeadbeef); |
| 2128 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); | 2128 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); |
| 2129 | } | 2129 | } |
| 2130 | { | 2130 | { |
| 2131 | const value = @intToPtr(*const fn () void, 0xdeadbeef); | 2131 | const value = @intToPtr(*align(1) const fn () void, 0xdeadbeef); |
| 2132 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); | 2132 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); |
| 2133 | } | 2133 | } |
| 2134 | } | 2134 | } |
lib/std/os/linux/io_uring.zig+7-1| ... | @@ -1902,6 +1902,12 @@ test "openat" { | ... | @@ -1902,6 +1902,12 @@ test "openat" { |
| 1902 | const path = "test_io_uring_openat"; | 1902 | const path = "test_io_uring_openat"; |
| 1903 | defer std.fs.cwd().deleteFile(path) catch {}; | 1903 | defer std.fs.cwd().deleteFile(path) catch {}; |
| 1904 | 1904 | ||
| 1905 | // Workaround for LLVM bug: https://github.com/ziglang/zig/issues/12014 | ||
| 1906 | const path_addr = if (builtin.zig_backend == .stage2_llvm) p: { | ||
| 1907 | var workaround = path; | ||
| 1908 | break :p @ptrToInt(workaround); | ||
| 1909 | } else @ptrToInt(path); | ||
| 1910 | |||
| 1905 | const flags: u32 = os.O.CLOEXEC | os.O.RDWR | os.O.CREAT; | 1911 | const flags: u32 = os.O.CLOEXEC | os.O.RDWR | os.O.CREAT; |
| 1906 | const mode: os.mode_t = 0o666; | 1912 | const mode: os.mode_t = 0o666; |
| 1907 | const sqe_openat = try ring.openat(0x33333333, linux.AT.FDCWD, path, flags, mode); | 1913 | const sqe_openat = try ring.openat(0x33333333, linux.AT.FDCWD, path, flags, mode); |
| ... | @@ -1911,7 +1917,7 @@ test "openat" { | ... | @@ -1911,7 +1917,7 @@ test "openat" { |
| 1911 | .ioprio = 0, | 1917 | .ioprio = 0, |
| 1912 | .fd = linux.AT.FDCWD, | 1918 | .fd = linux.AT.FDCWD, |
| 1913 | .off = 0, | 1919 | .off = 0, |
| 1914 | .addr = @ptrToInt(path), | 1920 | .addr = path_addr, |
| 1915 | .len = mode, | 1921 | .len = mode, |
| 1916 | .rw_flags = flags, | 1922 | .rw_flags = flags, |
| 1917 | .user_data = 0x33333333, | 1923 | .user_data = 0x33333333, |
lib/std/zig/c_translation.zig+1-1| ... | @@ -136,7 +136,7 @@ test "cast" { | ... | @@ -136,7 +136,7 @@ test "cast" { |
| 136 | const FnPtr = if (@import("builtin").zig_backend == .stage1) | 136 | const FnPtr = if (@import("builtin").zig_backend == .stage1) |
| 137 | ?fn (*anyopaque) void | 137 | ?fn (*anyopaque) void |
| 138 | else | 138 | else |
| 139 | ?*const fn (*anyopaque) void; | 139 | ?*align(1) const fn (*anyopaque) void; |
| 140 | try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0))); | 140 | try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0))); |
| 141 | try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1)))); | 141 | try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1)))); |
| 142 | } | 142 | } |