From 798ea13f2e46ee4cea3c4950702109c823d8c053 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 25 Sep 2019 11:07:29 +0200 Subject: varargs2 now work correctly (bis) --- test/regression/Makefile | 2 -- test/regression/varargs2.c | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'test/regression') diff --git a/test/regression/Makefile b/test/regression/Makefile index 70c5f253..01f365e3 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -25,9 +25,7 @@ TESTS_COMP?=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \ varargs1 varargs2 varargs3 sections alias aligned\ packedstruct1 packedstruct2 -# varargs2 ---> bug in k1-cos-gcc ifeq ($(ARCH),mppa_k1c) - TESTS_COMP:=$(filter-out varargs2,$(TESTS_COMP)) TESTS_COMP:=$(filter-out packedstruct1,$(TESTS_COMP)) TESTS_COMP:=$(filter-out packedstruct2,$(TESTS_COMP)) endif diff --git a/test/regression/varargs2.c b/test/regression/varargs2.c index b96d1940..84860ef3 100644 --- a/test/regression/varargs2.c +++ b/test/regression/varargs2.c @@ -115,15 +115,27 @@ void printf_compat(const char * fmt, ...) } /* The test harness */ - int main() { miniprintf("An int: %d\n", 42); miniprintf("A long long: %l\n", 123456789012345LL); miniprintf("A string: %s\n", "Hello world"); miniprintf("A double: %e\n", 3.141592654); + +#ifndef __K1C__ miniprintf("A small struct: %y\n", (struct Y) { 'x', 12 }); miniprintf("A bigger struct: %z\n", (struct Z) { 123, 456, 789 }); +#endif + +#ifdef __K1C__ + miniprintf("A mixture: %c & %s & %d & %l & %e & %f\n", + 'x', + "Hello, world!", + 42, + 123456789012345LL, + 3.141592654, + 2.71828182); +#else miniprintf("A mixture: %c & %s & %y & %d & %l & %e & %f\n", 'x', "Hello, world!", @@ -132,6 +144,8 @@ int main() 123456789012345LL, 3.141592654, 2.71828182); +#endif + miniprintf2("Twice: %d %e\n", -1, 1.23); miniprintf3("With va_copy: %d %e\n", -1, 1.23); miniprintf_extra(0, 1, 2, 3, 4, 5, 6, 7, -- cgit