Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / sso-15.c
blobd8a711d65767f60ca3d7a1725457edc8ece51afb
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
5 #define REV_ENDIANNESS __attribute__((scalar_storage_order("big-endian")))
6 #else
7 #define REV_ENDIANNESS __attribute__((scalar_storage_order("little-endian")))
8 #endif
10 struct X { int *p; } REV_ENDIANNESS;
12 struct X x;
14 struct X __attribute__((noinline)) foo (int *p)
16 struct X x;
17 x.p = p;
18 return x;
21 void __attribute((noinline)) bar (void)
23 *x.p = 1;
26 extern void abort (void);
28 int main (void)
30 int i = 0;
31 x = foo(&i);
32 bar();
33 if (i != 1)
34 abort ();
35 return 0;