aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-07 14:50:00 +0900
committernsfisis <nsfisis@gmail.com>2026-02-07 15:19:14 +0900
commit4fc8caf7db28d89d7f347004663ed2634f8f1bd7 (patch)
tree2dbe11fda97d5d86fb6fa63de2ccdb491629a7c5 /tests
parentb8780671f6768e3b5a09084d9f80c01bd544d2e8 (diff)
downloadducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.tar.gz
ducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.tar.zst
ducc-4fc8caf7db28d89d7f347004663ed2634f8f1bd7.zip
fix: function-like macro name not followed by parenthesis
Diffstat (limited to 'tests')
-rw-r--r--tests/macros.sh24
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