/*
Copyright (C) 2002-2009, Parrot Foundation.
$Id: test_c.in 43470 2010-01-16 00:22:36Z mikehh $

*/

#include <stdlib.h>
#include <stdio.h>

int
main()
{
    int i;
    union W {
        unsigned char b[sizeof (@iv@)/sizeof (unsigned char)];
        @iv@ w;
    } w;
#if defined(__ARM__) || defined(__arm__)
#  if defined(__ARMEB__)
    printf("87654321\n");
#  else
    printf("1234\n");
#  endif
    return 0;
#endif
    if (sizeof (w) == 4) {
        w.w = 0x04030201;
    }
    else {
        w.w = 0x08070605;
        w.w <<= 32;
        w.w |= 0x04030201;
    }

    for (i = 0; i < sizeof (w.b); i++) {
        printf("%1u", w.b[i]);
    }
    printf("\n");
    return 0;
}

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
