two_file_test_tls.cc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // two_file_test_tls.cc -- a two file test case for gold, main function, with TLS
  2. // Copyright (C) 2006-2022 Free Software Foundation, Inc.
  3. // Written by Ian Lance Taylor <iant@google.com>.
  4. // This file is part of gold.
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 3 of the License, or
  8. // (at your option) any later version.
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  16. // MA 02110-1301, USA.
  17. // This tests references between files. This is the main file. See
  18. // two_file_test_1.cc for details.
  19. #include <cassert>
  20. #include "two_file_test.h"
  21. extern __thread int tls1;
  22. int
  23. main()
  24. {
  25. // Initialize common data.
  26. v3 = 789;
  27. for (int i = 0; i < 13; ++i)
  28. v5[i] = v4[i];
  29. assert(tls1 == 123);
  30. assert(t1());
  31. assert(t1a());
  32. assert(t2());
  33. assert(t3());
  34. assert(t4());
  35. assert(t5());
  36. assert(t6());
  37. assert(t7());
  38. assert(t8());
  39. assert(t9());
  40. assert(t10());
  41. assert(t11());
  42. assert(t12());
  43. assert(t13());
  44. assert(t16());
  45. assert(t16a());
  46. assert(t17());
  47. assert(t18());
  48. return 0;
  49. }