mirror of
https://github.com/ziglang/zig.git
synced 2026-10-14 10:27:43 -04:00
zig build fmt
This commit is contained in:
1 parent
c0c911bfa7
commit
eb3c7f5706
10 files changed
+29
-33
No files matched your search
@@ -93,7 +93,7 @@ const cases__divmoddi4 =
|
|||||||
[_]i64{ 19, -5, -3, 4 },
|
[_]i64{ 19, -5, -3, 4 },
|
||||||
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
|
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
|
||||||
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
|
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
test "test_divmoddi4" {
|
test "test_divmoddi4" {
|
||||||
for (cases__divmoddi4) |case| {
|
for (cases__divmoddi4) |case| {
|
||||||
@@ -227,7 +227,7 @@ const cases__divmodsi4 =
|
|||||||
[_]i32{ 19, -5, -3, 4 },
|
[_]i32{ 19, -5, -3, 4 },
|
||||||
[_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
|
[_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
|
||||||
[_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
|
[_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
fn test_one_divmodsi4(a: i32, b: i32, expected_q: i32, expected_r: i32) !void {
|
fn test_one_divmodsi4(a: i32, b: i32, expected_q: i32, expected_r: i32) !void {
|
||||||
var r: i32 = undefined;
|
var r: i32 = undefined;
|
||||||
|
|||||||
+2
-2
@@ -9879,9 +9879,9 @@ pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8
|
|||||||
|
|
||||||
pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
|
pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
|
||||||
{} // android bionic and openbsd libc does not implement getcontext
|
{} // android bionic and openbsd libc does not implement getcontext
|
||||||
else if (native_os == .linux and builtin.target.abi.isMusl())
|
else if (native_os == .linux and builtin.target.abi.isMusl())
|
||||||
linux.getcontext
|
linux.getcontext
|
||||||
else
|
else
|
||||||
private.getcontext;
|
private.getcontext;
|
||||||
|
|
||||||
pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
|
pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
|
||||||
|
|||||||
@@ -1545,7 +1545,7 @@ pub const RequestError = ConnectTcpError || ConnectErrorPartial || Request.SendE
|
|||||||
|
|
||||||
CertificateBundleLoadFailure,
|
CertificateBundleLoadFailure,
|
||||||
UnsupportedTransferEncoding,
|
UnsupportedTransferEncoding,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const RequestOptions = struct {
|
pub const RequestOptions = struct {
|
||||||
version: http.Version = .@"HTTP/1.1",
|
version: http.Version = .@"HTTP/1.1",
|
||||||
|
|||||||
+2
-1
@@ -614,7 +614,8 @@ pub fn hasRuntimeBitsInner(
|
|||||||
strat,
|
strat,
|
||||||
zcu,
|
zcu,
|
||||||
tid,
|
tid,
|
||||||
)) {
|
))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -685,8 +685,7 @@ fn restoreState(func: *Func, state: State, deaths: []const Air.Inst.Index, compt
|
|||||||
|
|
||||||
const ExpectedContents = [@typeInfo(RegisterManager.TrackedRegisters).array.len]RegisterLock;
|
const ExpectedContents = [@typeInfo(RegisterManager.TrackedRegisters).array.len]RegisterLock;
|
||||||
var stack align(@max(@alignOf(ExpectedContents), @alignOf(std.heap.StackFallbackAllocator(0)))) =
|
var stack align(@max(@alignOf(ExpectedContents), @alignOf(std.heap.StackFallbackAllocator(0)))) =
|
||||||
if (opts.update_tracking)
|
if (opts.update_tracking) {} else std.heap.stackFallback(@sizeOf(ExpectedContents), func.gpa);
|
||||||
{} else std.heap.stackFallback(@sizeOf(ExpectedContents), func.gpa);
|
|
||||||
|
|
||||||
var reg_locks = if (opts.update_tracking) {} else try std.ArrayList(RegisterLock).initCapacity(
|
var reg_locks = if (opts.update_tracking) {} else try std.ArrayList(RegisterLock).initCapacity(
|
||||||
stack.get(),
|
stack.get(),
|
||||||
|
|||||||
@@ -82655,8 +82655,7 @@ fn restoreState(self: *CodeGen, state: State, deaths: []const Air.Inst.Index, co
|
|||||||
|
|
||||||
const ExpectedContents = [@typeInfo(RegisterManager.TrackedRegisters).array.len]RegisterLock;
|
const ExpectedContents = [@typeInfo(RegisterManager.TrackedRegisters).array.len]RegisterLock;
|
||||||
var stack align(@max(@alignOf(ExpectedContents), @alignOf(std.heap.StackFallbackAllocator(0)))) =
|
var stack align(@max(@alignOf(ExpectedContents), @alignOf(std.heap.StackFallbackAllocator(0)))) =
|
||||||
if (opts.update_tracking)
|
if (opts.update_tracking) {} else std.heap.stackFallback(@sizeOf(ExpectedContents), self.gpa);
|
||||||
{} else std.heap.stackFallback(@sizeOf(ExpectedContents), self.gpa);
|
|
||||||
|
|
||||||
var reg_locks = if (opts.update_tracking) {} else try std.ArrayList(RegisterLock).initCapacity(
|
var reg_locks = if (opts.update_tracking) {} else try std.ArrayList(RegisterLock).initCapacity(
|
||||||
stack.get(),
|
stack.get(),
|
||||||
|
|||||||
@@ -913,8 +913,7 @@ pub const Info = union(enum) {
|
|||||||
.function => |lhs_function_info| lhs_function_info.param_ctypes.len ==
|
.function => |lhs_function_info| lhs_function_info.param_ctypes.len ==
|
||||||
rhs_info.function.param_ctypes.len and
|
rhs_info.function.param_ctypes.len and
|
||||||
pool_adapter.eql(lhs_function_info.return_ctype, rhs_info.function.return_ctype) and
|
pool_adapter.eql(lhs_function_info.return_ctype, rhs_info.function.return_ctype) and
|
||||||
for (0..lhs_function_info.param_ctypes.len) |param_index|
|
for (0..lhs_function_info.param_ctypes.len) |param_index| {
|
||||||
{
|
|
||||||
if (!pool_adapter.eql(
|
if (!pool_adapter.eql(
|
||||||
lhs_function_info.param_ctypes.at(param_index, lhs_pool),
|
lhs_function_info.param_ctypes.at(param_index, lhs_pool),
|
||||||
rhs_info.function.param_ctypes.at(param_index, rhs_pool),
|
rhs_info.function.param_ctypes.at(param_index, rhs_pool),
|
||||||
|
|||||||
@@ -859,8 +859,7 @@ pub const Object = struct {
|
|||||||
builder.data_layout = try builder.fmt("{}", .{DataLayoutBuilder{ .target = target }});
|
builder.data_layout = try builder.fmt("{}", .{DataLayoutBuilder{ .target = target }});
|
||||||
|
|
||||||
const debug_compile_unit, const debug_enums_fwd_ref, const debug_globals_fwd_ref =
|
const debug_compile_unit, const debug_enums_fwd_ref, const debug_globals_fwd_ref =
|
||||||
if (!builder.strip)
|
if (!builder.strip) debug_info: {
|
||||||
debug_info: {
|
|
||||||
// We fully resolve all paths at this point to avoid lack of
|
// We fully resolve all paths at this point to avoid lack of
|
||||||
// source line info in stack traces or lack of debugging
|
// source line info in stack traces or lack of debugging
|
||||||
// information which, if relative paths were used, would be
|
// information which, if relative paths were used, would be
|
||||||
|
|||||||
+17
-17
@@ -3821,19 +3821,19 @@ const msdos_stub: [120]u8 = .{
|
|||||||
0x40, 0x00, // Absolute offset to relocation table. 64 matches the header size (all bytes before the MS-DOS stub program).
|
0x40, 0x00, // Absolute offset to relocation table. 64 matches the header size (all bytes before the MS-DOS stub program).
|
||||||
0x00, 0x00, // Overlay number. Zero means this is the main executable.
|
0x00, 0x00, // Overlay number. Zero means this is the main executable.
|
||||||
}
|
}
|
||||||
// Reserved words.
|
// Reserved words.
|
||||||
++ .{ 0x00, 0x00 } ** 4
|
++ .{ 0x00, 0x00 } ** 4
|
||||||
// OEM-related fields.
|
// OEM-related fields.
|
||||||
++ .{
|
++ .{
|
||||||
0x00, 0x00, // OEM identifier.
|
0x00, 0x00, // OEM identifier.
|
||||||
0x00, 0x00, // OEM information.
|
0x00, 0x00, // OEM information.
|
||||||
}
|
}
|
||||||
// Reserved words.
|
// Reserved words.
|
||||||
++ .{ 0x00, 0x00 } ** 10
|
++ .{ 0x00, 0x00 } ** 10
|
||||||
// Address of the PE header (a long). This matches the size of this entire MS-DOS stub, so that's the address of what's after this MS-DOS stub.
|
// Address of the PE header (a long). This matches the size of this entire MS-DOS stub, so that's the address of what's after this MS-DOS stub.
|
||||||
++ .{ 0x78, 0x00, 0x00, 0x00 }
|
++ .{ 0x78, 0x00, 0x00, 0x00 }
|
||||||
// What follows is a 16-bit x86 MS-DOS program of 7 instructions that prints the bytes after these instructions and then exits.
|
// What follows is a 16-bit x86 MS-DOS program of 7 instructions that prints the bytes after these instructions and then exits.
|
||||||
++ .{
|
++ .{
|
||||||
// Set the value of the data segment to the same value as the code segment.
|
// Set the value of the data segment to the same value as the code segment.
|
||||||
0x0e, // push cs
|
0x0e, // push cs
|
||||||
0x1f, // pop ds
|
0x1f, // pop ds
|
||||||
@@ -3848,11 +3848,11 @@ const msdos_stub: [120]u8 = .{
|
|||||||
0xb8, 0x01, 0x4c, // mov ax, 0x4c01
|
0xb8, 0x01, 0x4c, // mov ax, 0x4c01
|
||||||
// Peform the system call to exit the program with exit code 1.
|
// Peform the system call to exit the program with exit code 1.
|
||||||
0xcd, 0x21, // int 0x21
|
0xcd, 0x21, // int 0x21
|
||||||
}
|
}
|
||||||
// Message to print.
|
// Message to print.
|
||||||
++ "This program cannot be run in DOS mode.".*
|
++ "This program cannot be run in DOS mode.".*
|
||||||
// Message terminators.
|
// Message terminators.
|
||||||
++ .{
|
++ .{
|
||||||
'$', // We do not pass a length to the print system call; the string is terminated by this character.
|
'$', // We do not pass a length to the print system call; the string is terminated by this character.
|
||||||
0x00, 0x00, // Terminating zero bytes.
|
0x00, 0x00, // Terminating zero bytes.
|
||||||
};
|
};
|
||||||
+1
-2
@@ -5080,8 +5080,7 @@ fn finishTransFnProto(
|
|||||||
const is_noalias = param_qt.isRestrictQualified();
|
const is_noalias = param_qt.isRestrictQualified();
|
||||||
|
|
||||||
const param_name: ?[]const u8 =
|
const param_name: ?[]const u8 =
|
||||||
if (fn_decl) |decl|
|
if (fn_decl) |decl| blk: {
|
||||||
blk: {
|
|
||||||
const param = decl.getParamDecl(@as(c_uint, @intCast(i)));
|
const param = decl.getParamDecl(@as(c_uint, @intCast(i)));
|
||||||
const param_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(param)).getName_bytes_begin());
|
const param_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(param)).getName_bytes_begin());
|
||||||
if (param_name.len < 1)
|
if (param_name.len < 1)
|
||||||
|
|||||||
Reference in new issue
Block a user