diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-21 07:12:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:04:24 +0900 |
| commit | 82c99e92032b8101443671604de7137ba7257cd0 (patch) | |
| tree | caecbc6bb7d14dca184e07c0e9598f4131521b69 /tests | |
| parent | 4113cec4ecaef37eaa5638592bdc80ad7783d530 (diff) | |
| download | ducc-82c99e92032b8101443671604de7137ba7257cd0.tar.gz ducc-82c99e92032b8101443671604de7137ba7257cd0.tar.zst ducc-82c99e92032b8101443671604de7137ba7257cd0.zip | |
fix: fix dereference of struct members
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/054.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/054.sh b/tests/054.sh new file mode 100644 index 0000000..06252b9 --- /dev/null +++ b/tests/054.sh @@ -0,0 +1,23 @@ +set -e + +cat <<'EOF' > expected +0 +1 +EOF +bash ../../test_diff.sh <<'EOF' +int printf(); +void* calloc(); + +struct S { + int a; + int b; +}; + +int main() { + struct S* s = calloc(1, sizeof(struct S)); + s->b = 1; + printf("%ld\n", s->a); + printf("%ld\n", s->b); + return 0; +} +EOF |
