From 9807d9905be951e83fa20642d3c7695f5d6c9e04 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 11 Aug 2025 12:09:25 +0900 Subject: feat: support non-extern global variables --- tests/085.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/085.sh (limited to 'tests') diff --git a/tests/085.sh b/tests/085.sh new file mode 100644 index 0000000..10ab24c --- /dev/null +++ b/tests/085.sh @@ -0,0 +1,40 @@ +set -e + +cat <<'EOF' > expected +0 +42 +48 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +123 +EOF + +bash ../../test_diff.sh <<'EOF' +int printf(); + +int a; +int b[12]; + +int main() { + printf("%d\n", a); + a = 42; + printf("%d\n", a); + printf("%zu\n", sizeof(b)); + int i; + for (i = 0; i < 12; ++i) { + printf("%d\n", b[i]); + } + b[11] = 123; + printf("%d\n", b[11]); +} +EOF -- cgit v1.2.3-70-g09d2