mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
translate-c: Add test for using correct block label for StmtExpr
The previous iteration of translate-c used an incorrect block label in the break statement for a translated C statement expression. This adds a test to ensure the correct label is used in the new intermediate AST version of translate-c.
This commit is contained in:
parent
d5fecbd0ba
commit
3717bedb4e
@ -922,4 +922,13 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
|
||||
\\ return 0;
|
||||
\\}
|
||||
, "");
|
||||
|
||||
cases.add("Use correct break label for statement expression in nested scope",
|
||||
\\#include <stdlib.h>
|
||||
\\int main(void) {
|
||||
\\ int x = ({1, ({2; 3;});});
|
||||
\\ if (x != 3) abort();
|
||||
\\ return 0;
|
||||
\\}
|
||||
, "");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user