~ubuntu-branches/ubuntu/utopic/binutils-arm64-cross/utopic

« back to all changes in this revision

Viewing changes to binutils-2.23.52.20130611/ld/testsuite/ld-plugin/run-ie.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-06-20 17:38:09 UTC
  • Revision ID: package-import@ubuntu.com-20130620173809-app8lzgvymy5fg6c
Tags: 0.7
Build-depend on binutils-source (>= 2.23.52.20130620-1~).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
extern void abort (void);
 
4
 
 
5
__thread int tls_ie __attribute__((tls_model("initial-exec"))) = 4;
 
6
 
 
7
int get_ie (void)
 
8
{
 
9
  return tls_ie;
 
10
}
 
11
 
 
12
int *get_iep (void)
 
13
{
 
14
  return &tls_ie;
 
15
}
 
16
 
 
17
int main (void)
 
18
{
 
19
  int val;
 
20
 
 
21
  val = get_ie ();
 
22
  if (val != 4)
 
23
    abort ();
 
24
 
 
25
  val = *get_iep ();
 
26
  if (val != 4)
 
27
    abort ();
 
28
 
 
29
  printf ("IE: %d\n", val);
 
30
 
 
31
  return 0;
 
32
}