aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/tls-attr-le-pie.c
blob: b8ef7840d791b87692d22781c7dfd8275f0f14c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile { target { tls && pie } } } */
/* { dg-options "-O2 -fPIE -fdump-ipa-whole-program" } */

extern const int afoo[3];

__thread const int *pfoo __attribute__ ((tls_model ("initial-exec"))) = afoo;

const int **
ppfoo (void)
{
  return &pfoo;
}

/* tls_model should be local-exec due to -fPIE.  */
/* { dg-final { scan-ipa-dump "Varpool flags: initialized tls-local-exec" "whole-program" } } */