From 4fc8caf7db28d89d7f347004663ed2634f8f1bd7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 7 Feb 2026 14:50:00 +0900 Subject: fix: function-like macro name not followed by parenthesis --- tests/macros.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/macros.sh b/tests/macros.sh index 902f168..a6cf3df 100644 --- a/tests/macros.sh +++ b/tests/macros.sh @@ -422,3 +422,27 @@ int main() { #endif } EOF + +cat <<'EOF' > expected +42 +EOF +test_diff <<'EOF' +int printf(); + +#define m1(x) x + +int main() { + int m1 = 42; + printf("%d\n", m1); +} +EOF + +cat <<'EOF' > expected +struct { int foo; } s; +int x = ( ( 1) * 2); +EOF +test_cpp <<'EOF' +#define foo(x) ((x) * 2) +struct { int foo; } s; +int x = foo(1); +EOF -- cgit v1.3-1-g0d28