Disable gnat.dg/socket1.adb on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / align-9.c
blob24cba94f277f59f4dceb1899061d88518e14d8aa
1 /* Limit this to known non-strict alignment targets. */
2 /* { dg-do run { target { i?86-*-linux* x86_64-*-linux* } } } */
3 /* { dg-options "-O2 -fsanitize=alignment -fsanitize-recover=alignment" } */
5 __attribute__((noinline, noclone)) void
6 foo (void *p, const void *q)
8 *(long int *) p = *(const long int *) q;
11 int
12 main ()
14 struct S { long c; char f[64]; char d; char e[2 * sizeof (long)]; char g[64]; } s;
15 __builtin_memset (&s, '\0', sizeof s);
16 foo (&s.e[0], &s.e[sizeof (long)]);
17 return 0;
20 /* { dg-output "\.c:8:\[0-9]*: \[^\n\r]*load of misaligned address 0x\[0-9a-fA-F]* for type 'const long int', which requires \[48] byte alignment.*" } */
21 /* { dg-output "\.c:8:\[0-9]*: \[^\n\r]*store to misaligned address 0x\[0-9a-fA-F]* for type 'long int', which requires \[48] byte alignment" } */