(root)/
binutils-2.41/
ld/
testsuite/
ld-x86-64/
pr25416-5a.c
       1  #include <stdlib.h>
       2  #include <stdio.h>
       3  
       4  __thread int bar = 301;
       5  
       6  extern int *test1 (int);
       7  extern int *test2 (int);
       8  extern int *test3 (int);
       9  
      10  int
      11  main ()
      12  {
      13    int *p;
      14    p = test1 (30);
      15    if (*p != 30)
      16      abort ();
      17    *p = 40;
      18    test1 (40);
      19    p = test2 (301);
      20    if (*p != 301)
      21      abort ();
      22    if (p != &bar)
      23      abort ();
      24    *p = 40;
      25    test2 (40);
      26    p = test3 (40);
      27    if (*p != 40)
      28      abort ();
      29    *p = 50;
      30    test3 (50);
      31    puts ("PASS");
      32    return 0;
      33  }