aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/union_passing.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regression/union_passing.c')
-rw-r--r--test/regression/union_passing.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/regression/union_passing.c b/test/regression/union_passing.c
new file mode 100644
index 00000000..b0ce6319
--- /dev/null
+++ b/test/regression/union_passing.c
@@ -0,0 +1,23 @@
+#include <stdint.h>
+#include <stdio.h>
+static int32_t bk;
+union ba {
+ int64_t bb;
+};
+static void dada(union ba);
+void nothing(void);
+void stuff(void) {
+ union ba f = {5};
+ int32_t i[1000];
+ nothing();
+ dada(f);
+}
+static void dada(union ba k) {
+ bk = k.bb;
+}
+void nothing(void) {
+}
+int main() {
+ stuff();
+ printf("result = %d\n", bk);
+}