translate-c: use nested scope for comma operator in macros

Fixes #11040
This commit is contained in:
Evan Haas
2022-03-08 10:38:51 -08:00
committed by GitHub
parent d805adddd6
commit 4b9fd57aa8
4 changed files with 19 additions and 1 deletions

View File

@@ -1851,4 +1851,14 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
\\ return 0;
\\}
, "");
cases.add("Nested comma operator in macro. Issue #11040",
\\#include <stdlib.h>
\\#define FOO (1, (2, 3))
\\int main(void) {
\\ int x = FOO;
\\ if (x != 3) abort();
\\ return 0;
\\}
, "");
}