std.os.linux.io_uring: work around LLVM bug

See #12014
This commit is contained in:
Andrew Kelley
2022-07-05 20:39:24 -07:00
parent f639cb33a9
commit c34392b24e

View File

@@ -1902,6 +1902,12 @@ test "openat" {
const path = "test_io_uring_openat";
defer std.fs.cwd().deleteFile(path) catch {};
// Workaround for LLVM bug: https://github.com/ziglang/zig/issues/12014
const path_addr = if (builtin.zig_backend == .stage2_llvm) p: {
var workaround = path;
break :p @ptrToInt(workaround);
} else @ptrToInt(path);
const flags: u32 = os.O.CLOEXEC | os.O.RDWR | os.O.CREAT;
const mode: os.mode_t = 0o666;
const sqe_openat = try ring.openat(0x33333333, linux.AT.FDCWD, path, flags, mode);
@@ -1911,7 +1917,7 @@ test "openat" {
.ioprio = 0,
.fd = linux.AT.FDCWD,
.off = 0,
.addr = @ptrToInt(path),
.addr = path_addr,
.len = mode,
.rw_flags = flags,
.user_data = 0x33333333,