From 6f880873fbc49f44df6d2d19a76ceeb4052890c0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 4 Aug 2025 00:35:32 +0900 Subject: feat: support union types --- tests/082.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/082.sh (limited to 'tests') diff --git a/tests/082.sh b/tests/082.sh new file mode 100644 index 0000000..1d7727f --- /dev/null +++ b/tests/082.sh @@ -0,0 +1,24 @@ +set -e + +cat <<'EOF' > expected +8 +42 +42 +EOF + +bash ../../test_diff.sh <<'EOF' +int printf(); + +union U { + int i; + long l; +}; + +int main() { + union U u; + printf("%zu\n", sizeof(u)); + u.l = 42; + printf("%d\n", u.i); + printf("%ld\n", u.l); +} +EOF -- cgit v1.2.3-70-g09d2