aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/tls_test.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-08-15 04:57:46 +0000
committerCary Coutant <ccoutant@google.com>2008-08-15 04:57:46 +0000
commitd85c80a35397436352e65447cc42e5a0cde9c51a (patch)
treedc027ecf78d4c7f25bf8a3cec0d33d63499e2fff /gold/testsuite/tls_test.cc
parent56c2003cdefd26149d2524efdf68cf51f5ed8c89 (diff)
downloadbinutils-d85c80a35397436352e65447cc42e5a0cde9c51a.zip
binutils-d85c80a35397436352e65447cc42e5a0cde9c51a.tar.gz
binutils-d85c80a35397436352e65447cc42e5a0cde9c51a.tar.bz2
2008-08-14 Cary Coutant <ccoutant@google.com>
* x86_64.cc (Target_x86_64::Relocate::relocat_tls): Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs. * testsuite/tls_test.cc (struct int128): 128-bit struct for testing TLS relocs with non-zero addend. (v12): New TLS variable. (t12): New test. (t_last): Add check for v12. * testsuite/tls_test.h (t12): New function. * testsuite/tls_test_main.cc (thread_routine): Call new test.
Diffstat (limited to 'gold/testsuite/tls_test.cc')
-rw-r--r--gold/testsuite/tls_test.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/gold/testsuite/tls_test.cc b/gold/testsuite/tls_test.cc
index e859f8c..880bf23 100644
--- a/gold/testsuite/tls_test.cc
+++ b/gold/testsuite/tls_test.cc
@@ -73,6 +73,14 @@ 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()
{
@@ -187,6 +195,16 @@ t10()
}
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()
{
CHECK_EQ_OR_RETURN(v1, 10);
@@ -195,6 +213,8 @@ 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);