Additional very basic regression tests for byte_update

All other tests appear to be using arrays, these new ones don't.
This commit is contained in:
Michael Tautschnig 2017-05-19 17:14:22 +01:00
parent 8033beecc5
commit 808139b9d7
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#include <assert.h>
int main()
{
int x=0x01020304;
short *p=((short*)&x)+1;
*p=0xABCD;
assert(x==0xABCD0304);
p=(short*)(((char*)&x)+1);
*p=0xABCD;
assert(x==0xABABCD04);
}

View File

@ -0,0 +1,8 @@
CORE
main.c
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring

View File

@ -0,0 +1,12 @@
#include <assert.h>
int main()
{
int x=0x01020304;
short *p=((short*)&x)+1;
*p=0xABCD;
assert(x==0x0102ABCD);
p=(short*)(((char*)&x)+1);
*p=0xABCD;
assert(x==0x01ABCDCD);
}

View File

@ -0,0 +1,8 @@
CORE
main.c
--big-endian
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring