aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/varargs2.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-09-17 18:28:55 +0100
committerYann Herklotz <git@yannherklotz.com>2021-09-17 18:28:55 +0100
commita1c401a4eba5fc9fcf42933f70005ecb679a4c1c (patch)
tree26637fca5d1da9b3d049234721d593a60b03a6d3 /test/regression/varargs2.c
parentc49caca4b5f0239b43610fbfe012d6ba0211b364 (diff)
parent1daf96cdca4d828c333cea5c9a314ef861342984 (diff)
downloadcompcert-a1c401a4eba5fc9fcf42933f70005ecb679a4c1c.tar.gz
compcert-a1c401a4eba5fc9fcf42933f70005ecb679a4c1c.zip
Merge branch 'master' into dev/michalisdev/michalis
Diffstat (limited to 'test/regression/varargs2.c')
-rw-r--r--test/regression/varargs2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/regression/varargs2.c b/test/regression/varargs2.c
index b96d1940..d64509e5 100644
--- a/test/regression/varargs2.c
+++ b/test/regression/varargs2.c
@@ -104,6 +104,17 @@ void miniprintf_extra(int i1, int i2, int i3, int i4,
va_end(va);
}
+/* Add a few dummy FP arguments to test passing of variadic FP arguments
+ in integer registers (mostly relevant for RISC-V) */
+
+void miniprintf_float(double f1, double f2, const char * fmt, ...)
+{
+ va_list va;
+ va_start(va, fmt);
+ minivprintf(fmt, va);
+ va_end(va);
+}
+
/* Test va_list compatibility with the C library */
void printf_compat(const char * fmt, ...)
@@ -143,6 +154,11 @@ int main()
123456789012345LL,
3.141592654,
2.71828182);
+ miniprintf_float(0.0, 0.5,
+ "With extra FP args: %e & %f & %e & %e & %e & %e & %e & %e & %e & %e & %d\n",
+ 3.141592654,
+ 2.71828182,
+ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 42);
printf_compat("va_list compatibility: %c & %s & %d & %lld & %.10g & %.10g\n",
'x',
"Hello, world!",