From 16aa2c081db71181ba33aa205d2b0699efa29a99 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 2 Sep 2025 00:17:51 +0900 Subject: feat: support constant expression in array size --- tests/118.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/118.sh (limited to 'tests') diff --git a/tests/118.sh b/tests/118.sh new file mode 100644 index 0000000..48a8569 --- /dev/null +++ b/tests/118.sh @@ -0,0 +1,19 @@ +cat <<'EOF' > expected +400 +80 +16 +EOF + +test_diff <<'EOF' +int printf(); + +int main() { + int a[10 * 10]; + int b[10 + 10]; + int c[1 << 2]; + + printf("%zu\n", sizeof(a)); + printf("%zu\n", sizeof(b)); + printf("%zu\n", sizeof(c)); +} +EOF -- cgit v1.2.3-70-g09d2