aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/085.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-11 12:09:25 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:06:21 +0900
commit9807d9905be951e83fa20642d3c7695f5d6c9e04 (patch)
tree73af5bdd7f8b89fc9e63e8347fd3fd022f7f52c8 /tests/085.sh
parentb0d39831d7fa34fd47dd710d6635e5401f2d07de (diff)
downloadducc-9807d9905be951e83fa20642d3c7695f5d6c9e04.tar.gz
ducc-9807d9905be951e83fa20642d3c7695f5d6c9e04.tar.zst
ducc-9807d9905be951e83fa20642d3c7695f5d6c9e04.zip
feat: support non-extern global variables
Diffstat (limited to 'tests/085.sh')
-rw-r--r--tests/085.sh40
1 files changed, 40 insertions, 0 deletions
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