From d41a97e957ef616d194f60b9b79820cd0162d920 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 10 Sep 2025 23:29:52 +0900 Subject: feat: implement macro argument prescan cf. https://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html --- tests/test_macro_operators.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test_macro_operators.sh') diff --git a/tests/test_macro_operators.sh b/tests/test_macro_operators.sh index daf8f47..a77d3ca 100644 --- a/tests/test_macro_operators.sh +++ b/tests/test_macro_operators.sh @@ -41,3 +41,19 @@ int main() { } EOF +cat <<'EOF' > expected +123 +EOF +test_diff <<'EOF' +int printf(const char*, ...); + +#define F(x) CHECK(G(x)) +#define G(x) CHECK(H(x)) +#define CHECK(x) x + +int H(int n) { return n; } + +int main() { + printf("%d\n", F(123)); +} +EOF -- cgit v1.2.3-70-g09d2