re PR target/78796 (TLS fails to link on aarch64 with -mcmodel=large)

PR target/78796
	* gcc.dg/tls/pr78796.c: New test.

From-SVN: r243645
This commit is contained in:
Jakub Jelinek 2016-12-14 11:39:36 +01:00 committed by Jakub Jelinek
parent 007e18eb1f
commit e397febfb8
2 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-12-14 Jakub Jelinek <jakub@redhat.com>
PR target/78796
* gcc.dg/tls/pr78796.c: New test.
2016-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/78731

View File

@ -0,0 +1,32 @@
/* PR target/78796 */
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-mcmodel=large" { target aarch64-*-* } } */
/* { dg-require-effective-target tls } */
struct S { int a, b, c, d, e; };
struct S t;
__thread struct S s;
__attribute__((used, noinline, noclone)) void
foo (int *x, int *y)
{
asm volatile ("" : : "g" (x), "g" (y) : "memory");
if (*x != 1 || *y != 2)
__builtin_abort ();
}
__attribute__((used, noinline, noclone)) void
bar (void)
{
foo (&t.c, &s.c);
}
int
main ()
{
t.c = 1;
s.c = 2;
bar ();
return 0;
}