diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /src/regression/bool3.c | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'src/regression/bool3.c')
| -rw-r--r-- | src/regression/bool3.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/regression/bool3.c b/src/regression/bool3.c new file mode 100644 index 0000000..d3092da --- /dev/null +++ b/src/regression/bool3.c @@ -0,0 +1,65 @@ +#include "gpsim_assert.h" + + +/* Compound comparisons */ + + +unsigned char failures=0; + +unsigned int ui0 = 0; +unsigned int ui1 = 0; +unsigned char uc0 = 0; +unsigned char uc1 = 0; +unsigned long uL0 = 0; +unsigned long uL1 = 0; + +void +done() +{ + ASSERT(MANGLE(failures) == 0); + PASSED(); +} + +void compound_compare_uc(void) +{ + + failures += (uc0 != uc1); + +} + + +void compound_compare_ui(void) +{ + + failures += (ui0 != ui1); + +} + +void compound_compare_ul(void) +{ + + failures += (uL0 != uL1); + +} + +void compound_compare_uc_lit(void) +{ + + failures += (uc0 != 0xff); + failures += (uc0 != 0xff); + failures += (uc0 == 0); + +} + +void main(void) +{ + + compound_compare_uc(); + compound_compare_ui(); + compound_compare_ul(); + + uc0 = 0xff; + compound_compare_uc_lit(); + + done(); +} |
