From 268a53de823a6750d6256ee1fb1e7707b4b45740 Mon Sep 17 00:00:00 2001 From: Xavier ASUS Date: Fri, 18 Oct 2019 00:31:54 +0200 Subject: sdcc-3.9.0 fork implementing GNU assembler syntax This fork aims to provide better support for stm8-binutils --- src/regression/pointer1.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 src/regression/pointer1.c (limited to 'src/regression/pointer1.c') diff --git a/src/regression/pointer1.c b/src/regression/pointer1.c new file mode 100644 index 0000000..23075b4 --- /dev/null +++ b/src/regression/pointer1.c @@ -0,0 +1,134 @@ +#include "gpsim_assert.h" + +// Pointer tests + +unsigned char failures = 0; +unsigned char dummy; + +unsigned int aint0 = 0; +unsigned int aint1 = 0; +unsigned char achar0 = 0; +unsigned char achar1 = 0; +unsigned char *acharP = 0; + +unsigned char buff[10]; + +void +done() +{ + ASSERT(MANGLE(failures) == 0); + PASSED(); +} + +void +f1 (unsigned char *ucP) +{ + + if (ucP == 0) + { + failures++; + return; + } + + if (*ucP) + failures++; +} + +void +f2 (unsigned int *uiP) +{ + + if (uiP == 0) + { + failures++; + return; + } + + if (*uiP) + failures++; + +} + + +unsigned char * +f3 (void) +{ + + return &achar0; +} + + +void f4(unsigned char *ucP, unsigned char uc) +{ + + if(!ucP) { + failures++; + return; + } + + if(*ucP != uc) + failures++; + +} + +void init_array(char start_value) +{ + unsigned char c; + + for(c=0; c