From 75193c09f1dfcb3c7c726e5492f973a43402e270 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 30 Aug 2025 18:04:46 +0900 Subject: fix: parsing macro syntax --- tests/093.sh | 5 +++-- tests/108.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/108.sh (limited to 'tests') diff --git a/tests/093.sh b/tests/093.sh index fe0bda9..a22e168 100644 --- a/tests/093.sh +++ b/tests/093.sh @@ -13,7 +13,8 @@ int printf(); int main() { printf("%d\n", A(42)); - printf("%d\n", B(123)); - printf("%d\n", C(13, 17)); + printf("%d\n", B + (123)); + printf("%d\n", C (13, 17)); } EOF diff --git a/tests/108.sh b/tests/108.sh new file mode 100644 index 0000000..7dab53b --- /dev/null +++ b/tests/108.sh @@ -0,0 +1,26 @@ +cat <<'EOF' > expected +123 +EOF +test_diff <<'EOF' +#define A(x) x + +int printf(); + +int main() { + printf("%d\n", A ( 123 )); +} +EOF + +cat <<'EOF' > expected +main.c:4: expected ')', but got '' +EOF +test_compile_error <<'EOF' +#define A(x) x + +int main() { +#if A ( + 123) < A(345) + printf("1\n"); +#endif +} +EOF -- cgit v1.2.3-70-g09d2