diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-30 18:04:46 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-30 23:48:38 +0900 |
| commit | 75193c09f1dfcb3c7c726e5492f973a43402e270 (patch) | |
| tree | a276042945eab73eba5f0bf3cfdce0e298fb6de9 /tests | |
| parent | d08eca233036108dc46406788adbcec1a97af86c (diff) | |
| download | ducc-75193c09f1dfcb3c7c726e5492f973a43402e270.tar.gz ducc-75193c09f1dfcb3c7c726e5492f973a43402e270.tar.zst ducc-75193c09f1dfcb3c7c726e5492f973a43402e270.zip | |
fix: parsing macro syntax
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/093.sh | 5 | ||||
| -rw-r--r-- | tests/108.sh | 26 |
2 files changed, 29 insertions, 2 deletions
diff --git a/tests/093.sh b/tests/093.sh index fe0bda9..a22e168 100644 --- a/tests/093.sh +++ b/tests/093.sh @@ -13,7 +13,8 @@ int printf(); int main() { printf("%d\n", A(42)); - printf("%d\n", B(123)); - printf("%d\n", C(13, 17)); + printf("%d\n", B + (123)); + printf("%d\n", C (13, 17)); } EOF diff --git a/tests/108.sh b/tests/108.sh new file mode 100644 index 0000000..7dab53b --- /dev/null +++ b/tests/108.sh @@ -0,0 +1,26 @@ +cat <<'EOF' > expected +123 +EOF +test_diff <<'EOF' +#define A(x) x + +int printf(); + +int main() { + printf("%d\n", A ( 123 )); +} +EOF + +cat <<'EOF' > expected +main.c:4: expected ')', but got '<new-line>' +EOF +test_compile_error <<'EOF' +#define A(x) x + +int main() { +#if A ( + 123) < A(345) + printf("1\n"); +#endif +} +EOF |
