diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-07 14:50:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-07 15:19:14 +0900 |
| commit | 4fc8caf7db28d89d7f347004663ed2634f8f1bd7 (patch) | |
| tree | 2dbe11fda97d5d86fb6fa63de2ccdb491629a7c5 /tests/macros.sh | |
| parent | b8780671f6768e3b5a09084d9f80c01bd544d2e8 (diff) | |
| download | ducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.tar.gz ducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.tar.zst ducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.zip | |
fix: function-like macro name not followed by parenthesis
Diffstat (limited to 'tests/macros.sh')
| -rw-r--r-- | tests/macros.sh | 24 |
1 files changed, 24 insertions, 0 deletions
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 |
