zig fmt: remove trailing comma at the end of assembly clobber

This commit is contained in:
riChar
2022-09-02 17:52:33 +08:00
committed by GitHub
parent 36f4f32fad
commit 0d96f1f4fb
2 changed files with 35 additions and 3 deletions

View File

@@ -16,6 +16,28 @@ test "zig fmt: preserves clobbers in inline asm with stray comma" {
);
}
test "zig fmt: remove trailing comma at the end of assembly clobber" {
try testTransform(
\\fn foo() void {
\\ asm volatile (""
\\ : [_] "" (-> type),
\\ :
\\ : "clobber1", "clobber2",
\\ );
\\}
\\
,
\\fn foo() void {
\\ asm volatile (""
\\ : [_] "" (-> type),
\\ :
\\ : "clobber1", "clobber2"
\\ );
\\}
\\
);
}
test "zig fmt: respect line breaks in struct field value declaration" {
try testCanonical(
\\const Foo = struct {