* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / tls / pr78796.c
bloba0b23d63ab1cf3c66b8931454ab34050a8dac403
1 /* PR target/78796 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
4 /* { dg-additional-options "-mcmodel=large" { target aarch64-*-* } } */
5 /* { dg-require-effective-target tls } */
6 /* { dg-add-options tls } */
8 struct S { int a, b, c, d, e; };
9 struct S t;
10 __thread struct S s;
12 __attribute__((used, noinline, noclone)) void
13 foo (int *x, int *y)
15 asm volatile ("" : : "g" (x), "g" (y) : "memory");
16 if (*x != 1 || *y != 2)
17 __builtin_abort ();
20 __attribute__((used, noinline, noclone)) void
21 bar (void)
23 foo (&t.c, &s.c);
26 int
27 main ()
29 t.c = 1;
30 s.c = 2;
31 bar ();
32 return 0;