mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00:00
Merge remote-tracking branch 'origin/master' into llvm14
This commit is contained in:
commit
9a5c7b4b4d
@ -376,7 +376,7 @@ pub fn mknodat(dirfd: i32, path: [*:0]const u8, mode: u32, dev: u32) usize {
|
||||
return syscall4(.mknodat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, dev);
|
||||
}
|
||||
|
||||
pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize {
|
||||
pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: ?[*:0]const u8, flags: u32, data: usize) usize {
|
||||
return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);
|
||||
}
|
||||
|
||||
|
||||
@ -21614,10 +21614,10 @@ fn beginComptimePtrLoad(
|
||||
deref.ty_without_well_defined_layout = field_ptr.container_ty;
|
||||
}
|
||||
|
||||
const tv = &(deref.pointee orelse {
|
||||
const tv = deref.pointee orelse {
|
||||
deref.pointee = null;
|
||||
break :blk deref;
|
||||
});
|
||||
};
|
||||
const coerce_in_mem_ok =
|
||||
(try sema.coerceInMemoryAllowed(block, field_ptr.container_ty, tv.ty, false, target, src, src)) == .ok or
|
||||
(try sema.coerceInMemoryAllowed(block, tv.ty, field_ptr.container_ty, false, target, src, src)) == .ok;
|
||||
|
||||
@ -82,6 +82,7 @@ test {
|
||||
_ = @import("behavior/bugs/11179.zig");
|
||||
_ = @import("behavior/bugs/11181.zig");
|
||||
_ = @import("behavior/bugs/11213.zig");
|
||||
_ = @import("behavior/bugs/12003.zig");
|
||||
_ = @import("behavior/byteswap.zig");
|
||||
_ = @import("behavior/byval_arg_var.zig");
|
||||
_ = @import("behavior/call.zig");
|
||||
|
||||
7
test/behavior/bugs/12003.zig
Normal file
7
test/behavior/bugs/12003.zig
Normal file
@ -0,0 +1,7 @@
|
||||
test {
|
||||
comptime {
|
||||
const tuple_with_ptrs = .{ &0, &0 };
|
||||
const field_ptr = (&tuple_with_ptrs.@"0");
|
||||
_ = field_ptr.*;
|
||||
}
|
||||
}
|
||||
@ -14,4 +14,5 @@ fn doSomeAsm() void {
|
||||
// backend=llvm
|
||||
// target=native
|
||||
//
|
||||
// :6:5: error: unable to evaluate constant expression
|
||||
// :6:5: error: unable to resolve comptime value
|
||||
// :2:14: note: called from here
|
||||
|
||||
@ -8,8 +8,8 @@ export fn entry() void {
|
||||
}
|
||||
fn foo(x: i32) !void {
|
||||
switch (x) {
|
||||
0 ... 10 => return error.Foo,
|
||||
11 ... 20 => return error.Bar,
|
||||
0...10 => return error.Foo,
|
||||
11...20 => return error.Bar,
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
@ -19,4 +19,4 @@ fn foo(x: i32) !void {
|
||||
// target=native
|
||||
//
|
||||
// :5:9: error: duplicate switch value
|
||||
// :3:9: note: other value here
|
||||
// :3:9: note: previous value here
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
const msg = "Hello, World!\n";
|
||||
|
||||
fn length() usize {
|
||||
return msg.len;
|
||||
}
|
||||
|
||||
pub fn main() void {
|
||||
asm volatile ("ta 0x6d"
|
||||
:
|
||||
: [number] "{g1}" (4),
|
||||
[arg1] "{o0}" (1),
|
||||
[arg2] "{o1}" (@ptrToInt(msg)),
|
||||
[arg3] "{o2}" (length()),
|
||||
: "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", "memory"
|
||||
);
|
||||
}
|
||||
|
||||
// run
|
||||
// target=sparc64-linux
|
||||
//
|
||||
// Hello, World!
|
||||
//
|
||||
Loading…
x
Reference in New Issue
Block a user