~netblock-deactivatedaccount/ubuntu/natty/binutils/rtems-support

« back to all changes in this revision

Viewing changes to debian/patches/161_testcases_for_pr12327.patch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-12-31 16:31:48 UTC
  • mfrom: (2.3.25 experimental)
  • Revision ID: james.westby@ubuntu.com-20101231163148-sgwn7orc9hncg4hu
Tags: 2.21-3ubuntu1
Upload to natty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From e7e85a106013644ff9270931fdcd0ca32e37a465 Mon Sep 17 00:00:00 2001
 
2
From: H.J. Lu <hjl.tools@gmail.com>
 
3
Date: Tue, 28 Dec 2010 18:04:10 +0000
 
4
Subject: [PATCH] Add testcases for PR ld/12327.
 
5
 
 
6
2010-12-28  H.J. Lu  <hongjiu.lu@intel.com>
 
7
 
 
8
        PR ld/12327
 
9
        * ld-scripts/defined4.d: New.
 
10
        * ld-scripts/defined4.s: Likewise.
 
11
        * ld-scripts/defined4.t: Likewise.
 
12
        * ld-scripts/expr2.d: Likewise.
 
13
        * ld-scripts/expr2.s: Likewise.
 
14
        * ld-scripts/expr2.t: Likewise.
 
15
 
 
16
        * ld-scripts/defined.exp: Run defined4.
 
17
 
 
18
        * ld-scripts/expr.exp: Run expr2.
 
19
 
 
20
2010-12-30  Sedat Dilek  <sedat.dilek@gmail.com>
 
21
 
 
22
        * Cherry-picked commit cd1915cc656c7d80b808e916a75abf250c514364
 
23
        * Drop changes in history of ld/testsuite/ChangeLog
 
24
          (as wished by Matthias Klose)
 
25
---
 
26
 ld/testsuite/ld-scripts/defined.exp |    3 ++-
 
27
 ld/testsuite/ld-scripts/defined4.d  |   10 ++++++++++
 
28
 ld/testsuite/ld-scripts/defined4.s  |    4 ++++
 
29
 ld/testsuite/ld-scripts/defined4.t  |    6 ++++++
 
30
 ld/testsuite/ld-scripts/expr.exp    |    5 +++--
 
31
 ld/testsuite/ld-scripts/expr2.d     |    6 ++++++
 
32
 ld/testsuite/ld-scripts/expr2.s     |    4 ++++
 
33
 ld/testsuite/ld-scripts/expr2.t     |   11 +++++++++++
 
34
 8 files changed, 46 insertions(+), 3 deletions(-)
 
35
 create mode 100644 ld/testsuite/ld-scripts/defined4.d
 
36
 create mode 100644 ld/testsuite/ld-scripts/defined4.s
 
37
 create mode 100644 ld/testsuite/ld-scripts/defined4.t
 
38
 create mode 100644 ld/testsuite/ld-scripts/expr2.d
 
39
 create mode 100644 ld/testsuite/ld-scripts/expr2.s
 
40
 create mode 100644 ld/testsuite/ld-scripts/expr2.t
 
41
 
 
42
diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp
 
43
index 15cc079..6d0c9d5 100644
 
44
--- a/ld/testsuite/ld-scripts/defined.exp
 
45
+++ b/ld/testsuite/ld-scripts/defined.exp
 
46
@@ -1,6 +1,6 @@
 
47
 # Test DEFINED in a linker script.
 
48
 # By Ian Lance Taylor, Cygnus Support.
 
49
-#   Copyright 2001, 2003. 2005, 2006, 2007
 
50
+#   Copyright 2001, 2003, 2005, 2006, 2007, 2010
 
51
 #   Free Software Foundation, Inc.
 
52
 #
 
53
 # This file is part of the GNU Binutils.
 
54
@@ -66,4 +66,5 @@ if ![ld_simple_link $ld tmpdir/def "$LDFLAGS -T $srcdir/$subdir/defined.t tmpdir
 
55
 set prms_id 0
 
56
 run_dump_test "defined2"
 
57
 run_dump_test "defined3"
 
58
+run_dump_test "defined4"
 
59
 set LDFLAGS "$saved_LDFLAGS"
 
60
diff --git a/ld/testsuite/ld-scripts/defined4.d b/ld/testsuite/ld-scripts/defined4.d
 
61
new file mode 100644
 
62
index 0000000..2c3a6ea
 
63
--- /dev/null
 
64
+++ b/ld/testsuite/ld-scripts/defined4.d
 
65
@@ -0,0 +1,10 @@
 
66
+#ld: -Tdefined4.t
 
67
+#nm: -B
 
68
+#source: defined4.s
 
69
+
 
70
+# Check that arithmetic on DEFINED works.
 
71
+#...
 
72
+0+0 D defined
 
73
+#...
 
74
+0+0 D defined1
 
75
+#pass
 
76
diff --git a/ld/testsuite/ld-scripts/defined4.s b/ld/testsuite/ld-scripts/defined4.s
 
77
new file mode 100644
 
78
index 0000000..5969a44
 
79
--- /dev/null
 
80
+++ b/ld/testsuite/ld-scripts/defined4.s
 
81
@@ -0,0 +1,4 @@
 
82
+       .globl  defined
 
83
+       .data
 
84
+defined:
 
85
+       .word 0
 
86
diff --git a/ld/testsuite/ld-scripts/defined4.t b/ld/testsuite/ld-scripts/defined4.t
 
87
new file mode 100644
 
88
index 0000000..1221df2
 
89
--- /dev/null
 
90
+++ b/ld/testsuite/ld-scripts/defined4.t
 
91
@@ -0,0 +1,6 @@
 
92
+SECTIONS {
 
93
+       .text : { *(.text) }
 
94
+       .data : { *(.data) }
 
95
+       .bss : { *(.bss) *(COMMON) }
 
96
+}
 
97
+defined1 = defined;
 
98
diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp
 
99
index 34829e5..467abcb 100644
 
100
--- a/ld/testsuite/ld-scripts/expr.exp
 
101
+++ b/ld/testsuite/ld-scripts/expr.exp
 
102
@@ -1,6 +1,6 @@
 
103
-# Test ALIGN in a linker script.
 
104
+# Test expressions in a linker script.
 
105
 # By Nathan Sidwell, CodeSourcery LLC
 
106
-#   Copyright 2006, 2007
 
107
+#   Copyright 2006, 2007, 2010
 
108
 #   Free Software Foundation, Inc.
 
109
 #
 
110
 # This file is part of the GNU Binutils.
 
111
@@ -21,3 +21,4 @@
 
112
 # MA 02110-1301, USA.
 
113
 
 
114
 run_dump_test expr1
 
115
+run_dump_test expr2
 
116
diff --git a/ld/testsuite/ld-scripts/expr2.d b/ld/testsuite/ld-scripts/expr2.d
 
117
new file mode 100644
 
118
index 0000000..6f7e253
 
119
--- /dev/null
 
120
+++ b/ld/testsuite/ld-scripts/expr2.d
 
121
@@ -0,0 +1,6 @@
 
122
+# ld: -T expr2.t
 
123
+#nm: -B
 
124
+
 
125
+#...
 
126
+.* D defined
 
127
+#pass
 
128
diff --git a/ld/testsuite/ld-scripts/expr2.s b/ld/testsuite/ld-scripts/expr2.s
 
129
new file mode 100644
 
130
index 0000000..5969a44
 
131
--- /dev/null
 
132
+++ b/ld/testsuite/ld-scripts/expr2.s
 
133
@@ -0,0 +1,4 @@
 
134
+       .globl  defined
 
135
+       .data
 
136
+defined:
 
137
+       .word 0
 
138
diff --git a/ld/testsuite/ld-scripts/expr2.t b/ld/testsuite/ld-scripts/expr2.t
 
139
new file mode 100644
 
140
index 0000000..634eab2
 
141
--- /dev/null
 
142
+++ b/ld/testsuite/ld-scripts/expr2.t
 
143
@@ -0,0 +1,11 @@
 
144
+SECTIONS
 
145
+{
 
146
+  . = 0xc000;
 
147
+  .text :
 
148
+  {
 
149
+    _text = .;
 
150
+    *(.text)
 
151
+  }
 
152
+  _end = .;
 
153
+}
 
154
+ASSERT (_end - _text <= 0x100, "fail");
 
155
-- 
 
156
1.7.2.3
 
157