From 9d1867bfa7814b3eb0a017638d79fc694289ba61 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Thu, 23 Sep 2021 18:31:32 +0200 Subject: add union passing --- test/regression/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/regression/Makefile b/test/regression/Makefile index 9661a99e..c56532ff 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -18,7 +18,7 @@ TESTS?=int32 int64 floats floats-basics floats-lit \ funct3 expr5 struct7 struct8 struct11 struct12 casts1 casts2 char1 \ sizeof1 sizeof2 binops bool for1 for2 switch switch2 compound \ decl1 bitfields9 ptrs3 \ - parsing krfun ifconv + parsing krfun ifconv union_passing # Can run, but only in compiled mode, and have reference output in Results -- cgit From 2a0096bc0c6057577f10d6343063d9eca76cbdea Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Thu, 23 Sep 2021 18:31:55 +0200 Subject: union passing --- test/regression/union_passing.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/regression/union_passing.c (limited to 'test') 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 +#include +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); +} -- cgit