Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pr43698.c
blob1fc497c22c2b83b62da1873e6314a980ad9738a0
1 /* { dg-do run } */
2 /* { dg-options "-Os" } */
3 #include <stdint.h>
4 #include <stdlib.h>
7 char do_reverse_endian = 0;
9 # define bswap_32(x) \
10 ((((x) & 0xff000000) >> 24) | \
11 (((x) & 0x00ff0000) >> 8) | \
12 (((x) & 0x0000ff00) << 8) | \
13 (((x) & 0x000000ff) << 24))
15 #define EGET(X) \
16 (__extension__ ({ \
17 uint64_t __res; \
18 if (!do_reverse_endian) { __res = (X); \
19 } else if (sizeof(X) == 4) { __res = bswap_32((X)); \
20 } \
21 __res; \
22 }))
24 void __attribute__((noinline)) X(char **phdr, char **data, int *phoff)
26 *phdr = *data + EGET(*phoff);
29 int main()
31 char *phdr;
32 char *data = (char *)0x40164000;
33 int phoff = 0x34;
34 X(&phdr, &data, &phoff);
35 if (phdr != (char *)0x40164034)
36 abort ();
37 exit (0);