Update year range in copyright notice of binutils files
[deliverable/binutils-gdb.git] / gold / testsuite / tls_test.cc
index ca3d9c59814767f5ea17898b32a147b09460b27f..6495b1e31fffbe9f5156c05ea1424cfb7950ecd8 100644 (file)
@@ -1,6 +1,6 @@
 // tls_test.cc -- test TLS variables for gold
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006-2018 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -44,6 +44,7 @@
 // last  Verify that the above tests left the variables set correctly.
 
 
+#include "config.h"
 #include <cstdio>
 #include "tls_test.h"
 
 
 __thread int v1;
 static __thread int v2;
+
+// We don't use these pointers, but putting them in tests alignment on
+// a 64-bit target.
+__thread char* p1;
+char dummy;
+__thread char* p2 = &dummy;
+
 __thread int v3 = 3;
 static __thread int v4 = 4;
 __thread int v5;
 static __thread int v6;
 
+struct int128
+{
+  long long hi;
+  long long lo;
+};
+
+static __thread struct int128 v12 = { 115, 125 };
+
 bool
 t1()
 {
@@ -178,6 +194,16 @@ t10()
   return true;
 }
 
+bool
+t12()
+{
+  struct int128 newval = { 335, 345 };
+  CHECK_EQ_OR_RETURN((int) v12.hi, 115);
+  CHECK_EQ_OR_RETURN((int) v12.lo, 125);
+  v12 = newval;
+  return true;
+}
+
 bool
 t_last()
 {
@@ -187,8 +213,12 @@ t_last()
   CHECK_EQ_OR_RETURN(v4, 40);
   CHECK_EQ_OR_RETURN(v5, 50);
   CHECK_EQ_OR_RETURN(v6, 60);
+  CHECK_EQ_OR_RETURN((int) v12.hi, 335);
+  CHECK_EQ_OR_RETURN((int) v12.lo, 345);
   CHECK_EQ_OR_RETURN(o1, -10);
   CHECK_EQ_OR_RETURN(o2, -20);
   CHECK_EQ_OR_RETURN(o3, -30);
+  int check = t11_last();
+  CHECK_EQ_OR_RETURN(check, 1);
   return true;
 }
This page took 0.02379 seconds and 4 git commands to generate.