scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit f1e7be215f9658a82f7d409906b94e739a4d15ab
parent 537319fa232d4906aaf4a478bc9dcc5385c59483
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Wed, 29 Apr 2026 13:24:25 +0200

tests/cc: Use static functions in 0270-union

This helps creating the composed test.

Diffstat:
Mtests/cc/execute/0270-union.c | 8++++----
Atests/cc/execute/0271-struct.c | 17+++++++++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/tests/cc/execute/0270-union.c b/tests/cc/execute/0270-union.c @@ -11,15 +11,15 @@ struct sigaction { int sa_flags ; }; -int +static int _sigaction(int num, struct sigaction *sa, struct sigaction *osa) { return num != 3 ? -1 : 0; } -void +static void (*signal(int signum, void (* func) (int)))(int) -{ +{ struct sigaction osa , sa = { .__sigaction_u.__sa_handler = func, }; @@ -30,7 +30,7 @@ void return osa.__sigaction_u.__sa_handler ; } -void +static void sighdl(int signo) { return 0; diff --git a/tests/cc/execute/0271-struct.c b/tests/cc/execute/0271-struct.c @@ -0,0 +1,17 @@ +struct tt { + int sec; + char *zone; +}; + +static struct tt tt1 = {.zone = "UTC"}, *pt1 = &tt1; +static struct tt tt2, *pt2 = &tt2; + +int +main ( void ) +{ + *pt2 = tt1; + if (tt2.zone == 0) + return 1 ; + + return 0 ; +}