aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin/run-ie.c
blob: 32afa0a249218c2615c9e836268c8fa2743eb800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>

extern void abort (void);

__thread int tls_ie __attribute__((tls_model("initial-exec"))) = 4;

int get_ie (void)
{
  return tls_ie;
}

int *get_iep (void)
{
  return &tls_ie;
}

int main (void)
{
  int val;

  val = get_ie ();
  if (val != 4)
    abort ();

  val = *get_iep ();
  if (val != 4)
    abort ();

  printf ("IE: %d\n", val);

  return 0;
}