translate-c: fix redefinition of label on left recursive comma operator

Closes #13239
This commit is contained in:
Veikka Tuominen
2022-10-24 15:17:01 +03:00
parent d773b7e71f
commit 4fc944dde8
4 changed files with 10 additions and 7 deletions

View File

@@ -499,20 +499,20 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\int baz(int x, int y) { return 0; }
\\#define bar(x) (&x, +3, 4 == 4, 5 * 6, baz(1, 2), 2 % 2, baz(1,2))
, &[_][]const u8{
\\pub const foo = blk: {
\\pub const foo = blk_1: {
\\ _ = @TypeOf(foo);
\\ break :blk bar;
\\ break :blk_1 bar;
\\};
,
\\pub inline fn bar(x: anytype) @TypeOf(baz(@as(c_int, 1), @as(c_int, 2))) {
\\ return blk: {
\\ return blk_1: {
\\ _ = &x;
\\ _ = @as(c_int, 3);
\\ _ = @as(c_int, 4) == @as(c_int, 4);
\\ _ = @as(c_int, 5) * @as(c_int, 6);
\\ _ = baz(@as(c_int, 1), @as(c_int, 2));
\\ _ = @as(c_int, 2) % @as(c_int, 2);
\\ break :blk baz(@as(c_int, 1), @as(c_int, 2));
\\ break :blk_1 baz(@as(c_int, 1), @as(c_int, 2));
\\ };
\\}
});