aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-01 23:44:51 +0900
committernsfisis <nsfisis@gmail.com>2025-09-01 23:55:56 +0900
commit09a245679c8d01eaec71b22985a9895667280cad (patch)
treef77024dbfb3f69d48bed3c7faaae994d0d9a173d /tests
parent5c1716417609ac2cea1470b3d3bb38a6e758279a (diff)
downloadducc-09a245679c8d01eaec71b22985a9895667280cad.tar.gz
ducc-09a245679c8d01eaec71b22985a9895667280cad.tar.zst
ducc-09a245679c8d01eaec71b22985a9895667280cad.zip
feat: partially support anonymous structs/unions/enums
Diffstat (limited to 'tests')
-rw-r--r--tests/117.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/117.sh b/tests/117.sh
new file mode 100644
index 0000000..765dc58
--- /dev/null
+++ b/tests/117.sh
@@ -0,0 +1,31 @@
+cat <<'EOF' > expected
+8
+4
+4
+EOF
+
+test_diff <<'EOF'
+int printf();
+
+typedef struct {
+ int x;
+ int y;
+} S;
+
+typedef union {
+ int a;
+ char b;
+} U;
+
+typedef enum {
+ RED,
+ GREEN,
+ BLUE
+} E;
+
+int main() {
+ printf("%zu\n", sizeof(S));
+ printf("%zu\n", sizeof(U));
+ printf("%zu\n", sizeof(E));
+}
+EOF