diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-10 23:29:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-12 23:57:06 +0900 |
| commit | d41a97e957ef616d194f60b9b79820cd0162d920 (patch) | |
| tree | 3438962f2594d9254c9163954ee989ac17978db4 /tests/test_macro_operators.sh | |
| parent | b3efe5b6c04e809ba0a67308994c91adfbd15eff (diff) | |
| download | ducc-d41a97e957ef616d194f60b9b79820cd0162d920.tar.gz ducc-d41a97e957ef616d194f60b9b79820cd0162d920.tar.zst ducc-d41a97e957ef616d194f60b9b79820cd0162d920.zip | |
feat: implement macro argument prescan
cf. https://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html
Diffstat (limited to 'tests/test_macro_operators.sh')
| -rw-r--r-- | tests/test_macro_operators.sh | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
