diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/csky/fnargs-3.c')
-rw-r--r-- | gcc/testsuite/gcc.target/csky/fnargs-3.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/csky/fnargs-3.c b/gcc/testsuite/gcc.target/csky/fnargs-3.c new file mode 100644 index 00000000000..8cf3e5ce7f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/fnargs-3.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ + +/* Check that sub-word sized elements of structures passed in in + registers are handled correctly with respect to the current endianness. */ + +#include <stdlib.h> +#include <string.h> + +struct s { + short h; + char s[8]; +}; + +void +f (struct s *sp, struct s ss) +{ + if (sp->h != ss.h + || strcmp (sp->s, ss.s)) + abort (); +} + +int +main (void) +{ + struct s ss; + ss.h = 42; + strcpy (ss.s, "shazam!"); + f (&ss, ss); + return 0; +} + |