aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-04 21:25:46 +0900
committernsfisis <nsfisis@gmail.com>2025-05-04 21:43:26 +0900
commit3bfcc240c7c68fd3aff8535df4e9e8e384eb9205 (patch)
tree92d098b47536604f44ad5b7f6702da19c815b654 /tests
parent28c604c82bd76ec6bcbb0960ecadd706a6c20614 (diff)
downloadP4Dcc-3bfcc240c7c68fd3aff8535df4e9e8e384eb9205.tar.gz
P4Dcc-3bfcc240c7c68fd3aff8535df4e9e8e384eb9205.tar.zst
P4Dcc-3bfcc240c7c68fd3aff8535df4e9e8e384eb9205.zip
fix forward struct decl
Diffstat (limited to 'tests')
-rw-r--r--tests/036.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/036.sh b/tests/036.sh
new file mode 100644
index 0000000..2a60cf9
--- /dev/null
+++ b/tests/036.sh
@@ -0,0 +1,27 @@
+set -e
+
+cat <<'EOF' > expected
+42
+EOF
+bash ../../test_diff.sh <<'EOF'
+void* calloc();
+int printf();
+
+struct T;
+
+struct S {
+ struct T* a;
+};
+
+struct T {
+ int b;
+};
+
+int main() {
+ struct S* s = calloc(1, sizeof(struct S));
+ s->a = calloc(1, sizeof(struct T));
+ s->a->b = 42;
+ printf("%d\n", s->a->b);
+ return 0;
+}
+EOF