| author | |
| committer | |
| log | 08d41da916787ab0c19130dc4dc4e7b0e75c9fa8 |
| tree | bd54f4198e37b5baf708375632fb8419fd2d52c8 |
| parent | 66d86eccbe43e01500bd57dba13a4ce68aba8921 |
3 files changed, 51 insertions(+), 3 deletions(-)
std/valgrind.zig+2-2| ... | ... | @@ -12,7 +12,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3: |
| 12 | 12 | \\ roll $3, %%edi ; roll $13, %%edi |
| 13 | 13 | \\ roll $29, %%edi ; roll $19, %%edi |
| 14 | 14 | \\ xchgl %%ebx,%%ebx |
| 15 | : [_] "={edx}" (-> usize) | |
| 15 | : [_] "={edx}" (-> usize) | |
| 16 | 16 | : [_] "{eax}" (&[]usize{ request, a1, a2, a3, a4, a5 }), |
| 17 | 17 | [_] "0" (default) |
| 18 | 18 | : "cc", "memory" |
| ... | ... | @@ -23,7 +23,7 @@ pub fn doClientRequest(default: usize, request: usize, a1: usize, a2: usize, a3: |
| 23 | 23 | \\ rolq $3, %%rdi ; rolq $13, %%rdi |
| 24 | 24 | \\ rolq $61, %%rdi ; rolq $51, %%rdi |
| 25 | 25 | \\ xchgq %%rbx,%%rbx |
| 26 | : [_] "={rdx}" (-> usize) | |
| 26 | : [_] "={rdx}" (-> usize) | |
| 27 | 27 | : [_] "{rax}" (&[]usize{ request, a1, a2, a3, a4, a5 }), |
| 28 | 28 | [_] "0" (default) |
| 29 | 29 | : "cc", "memory" |
std/zig/parser_test.zig+41| ... | ... | @@ -2129,6 +2129,47 @@ test "zig fmt: comptime block in container" { |
| 2129 | 2129 | ); |
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | test "zig fmt: inline asm parameter alignment" { | |
| 2133 | try testCanonical( | |
| 2134 | \\pub fn main() void { | |
| 2135 | \\ asm volatile ( | |
| 2136 | \\ \\ foo | |
| 2137 | \\ \\ bar | |
| 2138 | \\ ); | |
| 2139 | \\ asm volatile ( | |
| 2140 | \\ \\ foo | |
| 2141 | \\ \\ bar | |
| 2142 | \\ : [_] "" (-> usize), | |
| 2143 | \\ [_] "" (-> usize) | |
| 2144 | \\ ); | |
| 2145 | \\ asm volatile ( | |
| 2146 | \\ \\ foo | |
| 2147 | \\ \\ bar | |
| 2148 | \\ : | |
| 2149 | \\ : [_] "" (0), | |
| 2150 | \\ [_] "" (0) | |
| 2151 | \\ ); | |
| 2152 | \\ asm volatile ( | |
| 2153 | \\ \\ foo | |
| 2154 | \\ \\ bar | |
| 2155 | \\ : | |
| 2156 | \\ : | |
| 2157 | \\ : "", "" | |
| 2158 | \\ ); | |
| 2159 | \\ asm volatile ( | |
| 2160 | \\ \\ foo | |
| 2161 | \\ \\ bar | |
| 2162 | \\ : [_] "" (-> usize), | |
| 2163 | \\ [_] "" (-> usize) | |
| 2164 | \\ : [_] "" (0), | |
| 2165 | \\ [_] "" (0) | |
| 2166 | \\ : "", "" | |
| 2167 | \\ ); | |
| 2168 | \\} | |
| 2169 | \\ | |
| 2170 | ); | |
| 2171 | } | |
| 2172 | ||
| 2132 | 2173 | const std = @import("std"); |
| 2133 | 2174 | const mem = std.mem; |
| 2134 | 2175 | const warn = std.debug.warn; |
std/zig/render.zig+8-1| ... | ... | @@ -1549,7 +1549,14 @@ fn renderExpression( |
| 1549 | 1549 | try renderExpression(allocator, stream, tree, indent, start_col, asm_node.template, Space.Newline); |
| 1550 | 1550 | |
| 1551 | 1551 | const indent_once = indent + indent_delta; |
| 1552 | try stream.writeByteNTimes(' ', indent_once); | |
| 1552 | ||
| 1553 | if (asm_node.template.id == ast.Node.Id.MultilineStringLiteral) { | |
| 1554 | // After rendering a multiline string literal the cursor is | |
| 1555 | // already offset by indent | |
| 1556 | try stream.writeByteNTimes(' ', indent_delta); | |
| 1557 | } else { | |
| 1558 | try stream.writeByteNTimes(' ', indent_once); | |
| 1559 | } | |
| 1553 | 1560 | |
| 1554 | 1561 | const colon1 = tree.nextToken(asm_node.template.lastToken()); |
| 1555 | 1562 | const indent_extra = indent_once + 2; |