blob: 8cf3e5ce7f68ad298ef4005786d294cc66778374 [file] [log] [blame]
/* { 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;
}