aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-07-21 10:09:06 +0100
committerNick Clifton <nickc@redhat.com>2017-07-21 10:13:18 +0100
commitba8826a82a29a19b78c18ce4f44fe313de279af7 (patch)
tree2389430a2bbbff988df9fbba2fbb79f40345d735 /gas/testsuite
parent47826cdbec2548cd1d25acf4cfaf908ae88f3325 (diff)
downloadgdb-ba8826a82a29a19b78c18ce4f44fe313de279af7.zip
gdb-ba8826a82a29a19b78c18ce4f44fe313de279af7.tar.gz
gdb-ba8826a82a29a19b78c18ce4f44fe313de279af7.tar.bz2
This patch introduces support for specifing views in .loc directives, so that the compiler can use the assembler to generate line number information and have the assembler determine view numbers to multiple views at the same program counter.
binutils* dwarf.c (struct State_Machine_Registers): Add view field. (reset_state_machine): Reset view. (process_extended_line_op): Reset view when appropriate. (display_debug_lines_raw): Increment or reset view when appropriate. Print nonzero views. Support print view resets, disabled by default. (display_debug_lines_decoded): Likewise. Disambiguate op_code tests, enabling printing of end_sequence. * testsuite/binutils-all/dw2-1.W: Add nonzero views. * testsuite/binutils-all/dw2-3.W: Likewise. * testsuite/binutils-all/dw2-3gabi.W: Likewise. * testsuite/binutils-all/dw5.W: Add end sequence lines. * testsuite/binutils-all/i386/compressed-1a.d: Add nonzero views. * testsuite/binutils-all/libdw2-compressedgabi.out: Likewise. * testsuite/binutils-all/objdump.W: Likewise. * testsuite/binutils-all/objdump.WL: Add end sequence lines. * testsuite/binutils-all/x86-64/compressed-1a.d: Add nonzero views. gas * doc/as.texinfo (.loc): Document view support. * dwarf2dbg.c (unused): Check offset of next in struct line_entry. (current): Initialize view. (force_reset_view, view_assert_failed): New variables. (reverse_line_entry_list): New function. (set_or_check_view): Likewise. (dwarf2_gen_line_info_1): Call it. (dwarf2_where): Set view to NULL. (dwarf2_emit_insn): Return early when called before first file. (dwarf2_directive_loc): Add view support. Emit insn immediately when view option is given. (process_entries): Avoid set_address to reset view when a known address change already implies the view reset. (dwarf2dbg_final_check): New function. * dwarf2dbg.h (struct dwarf2_line_info): Add view. (dwarf2dbg_final_check): Declare. * read.c (s_leb128): Parse expression as deferred. * testsuite/gas/all/gas.exp: Run sleb128-9. * testsuite/gas/all/sleb128-9.d: New. * testsuite/gas/all/sleb128-9.l: New. * testsuite/gas/all/sleb128-9.s: New. * testsuite/gas/elf/dwarf2-1.d: Add nonzero views. * testsuite/gas/elf/dwarf2-2.d: Likewise. * testsuite/gas/elf/dwarf2-5.d: New. * testsuite/gas/elf/dwarf2-5.s: New. * testsuite/gas/elf/dwarf2-6.d: New. * testsuite/gas/elf/dwarf2-6.s: New. * testsuite/gas/elf/dwarf2-7.d: New. * testsuite/gas/elf/dwarf2-7.s: New. * testsuite/gas/elf/dwarf2-8.d: New. * testsuite/gas/elf/dwarf2-8.l: New. * testsuite/gas/elf/dwarf2-8.s: New. * testsuite/gas/elf/dwarf2-9.d: New. * testsuite/gas/elf/dwarf2-9.l: New. * testsuite/gas/elf/dwarf2-9.s: New. * testsuite/gas/elf/dwarf2-10.d: New. * testsuite/gas/elf/dwarf2-10.l: New. * testsuite/gas/elf/dwarf2-10.s: New. * testsuite/gas/elf/dwarf2-11.d: New. * testsuite/gas/elf/dwarf2-11.s: New. * testsuite/gas/elf/dwarf2-12.d: New. * testsuite/gas/elf/dwarf2-12.s: New. * testsuite/gas/elf/dwarf2-13.d: New. * testsuite/gas/elf/dwarf2-13.s: New. * testsuite/gas/elf/dwarf2-14.d: New. * testsuite/gas/elf/dwarf2-14.s: New. * testsuite/gas/elf/dwarf2-15.d: New. * testsuite/gas/elf/dwarf2-15.s: New. * testsuite/gas/elf/dwarf2-16.d: New. * testsuite/gas/elf/dwarf2-16.s: New. * testsuite/gas/elf/dwarf2-17.d: New. * testsuite/gas/elf/dwarf2-17.s: New. * testsuite/gas/elf/dwarf2-18.d: New. * testsuite/gas/elf/dwarf2-18.s: New. * testsuite/gas/elf/elf.exp: Run dwarf2-5..18 tests. * testsuite/gas/i386/dw2-compress-1.d: Add nonzero views. * testsuite/gas/i386/dw2-compressed-1.d: Likewise. * testsuite/gas/i386/ilp32/lns/lns-duplicate.d: Likewise. * testsuite/gas/lns/lns-big-delta.d: Likewise. * testsuite/gas/lns/lns-duplicate.d: Likewise. * testsuite/gas/mips/loc-swap-2.d: Likewise. * testsuite/gas/mips/loc-swap-3.d: Likewise. * testsuite/gas/mips/loc-swap.d: Likewise. * testsuite/gas/mips/micromips@loc-swap-2.d: Likewise. * testsuite/gas/mips/micromips@loc-swap.d: Likewise. * testsuite/gas/mips/mips16@loc-swap-2.d: Likewise. * testsuite/gas/mips/mips16@loc-swap.d: Likewise. * testsuite/gas/mips/mips16e@loc-swap.d: Likewise. * write.c (write_object_file): Check pending view asserts. (cvt_frag_to_fill): Complain about undefined leb128 operand.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/all/gas.exp1
-rw-r--r--gas/testsuite/gas/all/sleb128-9.d5
-rw-r--r--gas/testsuite/gas/all/sleb128-9.l3
-rw-r--r--gas/testsuite/gas/all/sleb128-9.s3
-rw-r--r--gas/testsuite/gas/avr/large-debug-line-table.d2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-1.d2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-10.d6
-rw-r--r--gas/testsuite/gas/elf/dwarf2-10.l2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-10.s32
-rw-r--r--gas/testsuite/gas/elf/dwarf2-11.d15
-rw-r--r--gas/testsuite/gas/elf/dwarf2-11.s28
-rw-r--r--gas/testsuite/gas/elf/dwarf2-12.d20
-rw-r--r--gas/testsuite/gas/elf/dwarf2-12.s31
-rw-r--r--gas/testsuite/gas/elf/dwarf2-13.d19
-rw-r--r--gas/testsuite/gas/elf/dwarf2-13.s33
-rw-r--r--gas/testsuite/gas/elf/dwarf2-14.d19
-rw-r--r--gas/testsuite/gas/elf/dwarf2-14.s32
-rw-r--r--gas/testsuite/gas/elf/dwarf2-15.d19
-rw-r--r--gas/testsuite/gas/elf/dwarf2-15.s32
-rw-r--r--gas/testsuite/gas/elf/dwarf2-16.d20
-rw-r--r--gas/testsuite/gas/elf/dwarf2-16.s33
-rw-r--r--gas/testsuite/gas/elf/dwarf2-17.d20
-rw-r--r--gas/testsuite/gas/elf/dwarf2-17.s33
-rw-r--r--gas/testsuite/gas/elf/dwarf2-18.d19
-rw-r--r--gas/testsuite/gas/elf/dwarf2-18.s33
-rw-r--r--gas/testsuite/gas/elf/dwarf2-2.d2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-5.d79
-rw-r--r--gas/testsuite/gas/elf/dwarf2-5.s58
-rw-r--r--gas/testsuite/gas/elf/dwarf2-6.d78
-rw-r--r--gas/testsuite/gas/elf/dwarf2-6.s101
-rw-r--r--gas/testsuite/gas/elf/dwarf2-7.d19
-rw-r--r--gas/testsuite/gas/elf/dwarf2-7.s36
-rw-r--r--gas/testsuite/gas/elf/dwarf2-8.d5
-rw-r--r--gas/testsuite/gas/elf/dwarf2-8.l2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-8.s27
-rw-r--r--gas/testsuite/gas/elf/dwarf2-9.d5
-rw-r--r--gas/testsuite/gas/elf/dwarf2-9.l2
-rw-r--r--gas/testsuite/gas/elf/dwarf2-9.s32
-rw-r--r--gas/testsuite/gas/elf/elf.exp14
-rw-r--r--gas/testsuite/gas/i386/dw2-compress-1.d2
-rw-r--r--gas/testsuite/gas/i386/dw2-compressed-1.d2
-rw-r--r--gas/testsuite/gas/i386/ilp32/lns/lns-duplicate.d2
-rw-r--r--gas/testsuite/gas/lns/lns-big-delta.d2
-rw-r--r--gas/testsuite/gas/lns/lns-common-1-alt.d16
-rw-r--r--gas/testsuite/gas/lns/lns-duplicate.d2
-rw-r--r--gas/testsuite/gas/mips/loc-swap-2.d6
-rw-r--r--gas/testsuite/gas/mips/loc-swap-3.d2
-rw-r--r--gas/testsuite/gas/mips/loc-swap.d6
-rw-r--r--gas/testsuite/gas/mips/micromips@loc-swap-2.d6
-rw-r--r--gas/testsuite/gas/mips/micromips@loc-swap.d4
-rw-r--r--gas/testsuite/gas/mips/mips16@loc-swap-2.d6
-rw-r--r--gas/testsuite/gas/mips/mips16@loc-swap.d6
-rw-r--r--gas/testsuite/gas/mips/mips16e@loc-swap.d6
53 files changed, 953 insertions, 37 deletions
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index b5b0beb..e43947d 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -394,6 +394,7 @@ if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] } {
run_dump_test sleb128-7
run_dump_test sleb128-8
}
+run_dump_test sleb128-9
# .byte is 32 bits on tic4x, and .p2align isn't supported on tic54x
# .space is different on hppa*-hpux.
diff --git a/gas/testsuite/gas/all/sleb128-9.d b/gas/testsuite/gas/all/sleb128-9.d
new file mode 100644
index 0000000..5c5997f
--- /dev/null
+++ b/gas/testsuite/gas/all/sleb128-9.d
@@ -0,0 +1,5 @@
+#name: undefined symbols in sleb128 directive
+#source: sleb128-9.s
+#error-output: sleb128-9.l
+#not-target: riscv*-*
+
diff --git a/gas/testsuite/gas/all/sleb128-9.l b/gas/testsuite/gas/all/sleb128-9.l
new file mode 100644
index 0000000..19842fa
--- /dev/null
+++ b/gas/testsuite/gas/all/sleb128-9.l
@@ -0,0 +1,3 @@
+[^:]*: Assembler messages:
+[^:]*:2: Error: leb128 operand is an undefined symbol: \.Lundef
+[^:]*:3: Error: leb128 operand is an undefined symbol: undef
diff --git a/gas/testsuite/gas/all/sleb128-9.s b/gas/testsuite/gas/all/sleb128-9.s
new file mode 100644
index 0000000..87cb955
--- /dev/null
+++ b/gas/testsuite/gas/all/sleb128-9.s
@@ -0,0 +1,3 @@
+ .data
+ .sleb128 .Lundef
+ .sleb128 undef
diff --git a/gas/testsuite/gas/avr/large-debug-line-table.d b/gas/testsuite/gas/avr/large-debug-line-table.d
index 31ca7ed..ecba3df 100644
--- a/gas/testsuite/gas/avr/large-debug-line-table.d
+++ b/gas/testsuite/gas/avr/large-debug-line-table.d
@@ -9,7 +9,7 @@
Decoded dump of debug contents of section \.debug_line:
CU: large-debug-line-table\.c:
-File name Line number Starting address
+File name Line number Starting address.*
large-debug-line-table\.c 1 0
#...
diff --git a/gas/testsuite/gas/elf/dwarf2-1.d b/gas/testsuite/gas/elf/dwarf2-1.d
index bae2f63..d8b79ef 100644
--- a/gas/testsuite/gas/elf/dwarf2-1.d
+++ b/gas/testsuite/gas/elf/dwarf2-1.d
@@ -71,7 +71,7 @@ Raw dump of debug contents of section .[z]?debug_line:
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Advance Line by 3 to 4
\[0x.*\] Copy
- \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/elf/dwarf2-10.d b/gas/testsuite/gas/elf/dwarf2-10.d
new file mode 100644
index 0000000..13c3171
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-10.d
@@ -0,0 +1,6 @@
+#as:
+#name: DWARF2 10
+#error-output: dwarf2-10.l
+# The mep target tries to relay code sections which breaks symbolic view computations.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: mep-* tile*-*
diff --git a/gas/testsuite/gas/elf/dwarf2-10.l b/gas/testsuite/gas/elf/dwarf2-10.l
new file mode 100644
index 0000000..b5f1f65
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-10.l
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*: Error: view number mismatch
diff --git a/gas/testsuite/gas/elf/dwarf2-10.s b/gas/testsuite/gas/elf/dwarf2-10.s
new file mode 100644
index 0000000..d159d43
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-10.s
@@ -0,0 +1,32 @@
+/* Test view numbering zero-assert checking with zero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-10.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-10.c"
+ .loc 1 1 view 0
+ .balign 4 /* No skip needed here... */
+ .loc 1 2 view 0 /* so this zero-view check fails. */
+ .int 0
+ .loc 1 3 view 0
+ .balign 8 /* Skip 4 more bytes after .int... */
+ .loc 1 4 view 0 /* so this is a zero view indeed. */
+ .int 0
+ .size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-11.d b/gas/testsuite/gas/elf/dwarf2-11.d
new file mode 100644
index 0000000..797d50d
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-11.d
@@ -0,0 +1,15 @@
+#as:
+#readelf: -wL
+#name: DWARF2 11
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* m32c-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-11\.c:
+File name *Line number *Starting address *View
+dwarf2-11\.c *1 *0x4
+dwarf2-11\.c *2 *0x8
+dwarf2-11\.c *2 *0x8 *1
diff --git a/gas/testsuite/gas/elf/dwarf2-11.s b/gas/testsuite/gas/elf/dwarf2-11.s
new file mode 100644
index 0000000..a1b0d0a
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-11.s
@@ -0,0 +1,28 @@
+/* Test view numbering zero-assert checking with nonzero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-11.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-11.c"
+ .dc.l 0
+ .loc 1 1 view 0
+ .balign 8
+ .loc 1 2 view 0
+ .size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-12.d b/gas/testsuite/gas/elf/dwarf2-12.d
new file mode 100644
index 0000000..0e1bc9b
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-12.d
@@ -0,0 +1,20 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 12
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-12\.c:
+File name *Line number *Starting address *View
+dwarf2-12\.c *1 *0
+dwarf2-12\.c *2 *0
+dwarf2-12\.c *3 *0 *1
+dwarf2-12\.c *3 *0x4
diff --git a/gas/testsuite/gas/elf/dwarf2-12.s b/gas/testsuite/gas/elf/dwarf2-12.s
new file mode 100644
index 0000000..3e3392a
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-12.s
@@ -0,0 +1,31 @@
+/* Test view numbering forced reset in a single frag.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-12.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-12.c"
+ .loc 1 1 view 0
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-13.d b/gas/testsuite/gas/elf/dwarf2-13.d
new file mode 100644
index 0000000..6961a6b
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-13.d
@@ -0,0 +1,19 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 13
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-13\.c:
+File name *Line number *Starting address *View
+dwarf2-13\.c *1 *0x4
+dwarf2-13\.c *2 *0x8
+dwarf2-13\.c *3 *0x8 *1
+dwarf2-13\.c *3 *0xc
diff --git a/gas/testsuite/gas/elf/dwarf2-13.s b/gas/testsuite/gas/elf/dwarf2-13.s
new file mode 100644
index 0000000..118d692
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-13.s
@@ -0,0 +1,33 @@
+/* Test view numbering forced reset after a nonzero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-13.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-13.c"
+ .dc.l 0
+ .loc 1 1 view 0
+ .balign 8
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-14.d b/gas/testsuite/gas/elf/dwarf2-14.d
new file mode 100644
index 0000000..88af145
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-14.d
@@ -0,0 +1,19 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 14
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-14\.c:
+File name *Line number *Starting address *View
+dwarf2-14\.c *1 *0
+dwarf2-14\.c *2 *0
+dwarf2-14\.c *3 *0 *1
+dwarf2-14\.c *3 *0x4
diff --git a/gas/testsuite/gas/elf/dwarf2-14.s b/gas/testsuite/gas/elf/dwarf2-14.s
new file mode 100644
index 0000000..80f91ff
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-14.s
@@ -0,0 +1,32 @@
+/* Test view numbering forced reset after a zero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-14.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-14.c"
+ .loc 1 1 view 0
+ .balign 4
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-15.d b/gas/testsuite/gas/elf/dwarf2-15.d
new file mode 100644
index 0000000..c7280e5
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-15.d
@@ -0,0 +1,19 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 15
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-15\.c:
+File name *Line number *Starting address *View
+dwarf2-15\.c *1 *0
+dwarf2-15\.c *2 *0x4
+dwarf2-15\.c *3 *0x4 *1
+dwarf2-15\.c *3 *0x8
diff --git a/gas/testsuite/gas/elf/dwarf2-15.s b/gas/testsuite/gas/elf/dwarf2-15.s
new file mode 100644
index 0000000..e41f84a
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-15.s
@@ -0,0 +1,32 @@
+/* Test view numbering forced reset in a single frag.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-15.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-15.c"
+ .loc 1 1 view 0
+ .dc.l 0
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-16.d b/gas/testsuite/gas/elf/dwarf2-16.d
new file mode 100644
index 0000000..b01292e
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-16.d
@@ -0,0 +1,20 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 16
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The mep target tries to relay code sections which breaks symbolic view computations.
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-16\.c:
+File name *Line number *Starting address *View
+dwarf2-16\.c *1 *0
+dwarf2-16\.c *2 *0x4
+dwarf2-16\.c *3 *0x4 *1
+dwarf2-16\.c *3 *0x8
diff --git a/gas/testsuite/gas/elf/dwarf2-16.s b/gas/testsuite/gas/elf/dwarf2-16.s
new file mode 100644
index 0000000..deacf56
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-16.s
@@ -0,0 +1,33 @@
+/* Test view numbering after a zero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-16.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-16.c"
+ .loc 1 1 view 0
+ .dc.l 0
+ .loc 1 2 view 0
+ .balign 4
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-17.d b/gas/testsuite/gas/elf/dwarf2-17.d
new file mode 100644
index 0000000..8c5c287
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-17.d
@@ -0,0 +1,20 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 17
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The mep target tries to relay code sections which breaks symbolic view computations.
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 00 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-17\.c:
+File name *Line number *Starting address *View
+dwarf2-17\.c *1 *0
+dwarf2-17\.c *2 *0x4
+dwarf2-17\.c *3 *0x8
+dwarf2-17\.c *3 *0xc
diff --git a/gas/testsuite/gas/elf/dwarf2-17.s b/gas/testsuite/gas/elf/dwarf2-17.s
new file mode 100644
index 0000000..4e5d91b
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-17.s
@@ -0,0 +1,33 @@
+/* Test view numbering after a nonzero-sized align.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-17.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-17.c"
+ .loc 1 1 view 0
+ .dc.l 0
+ .loc 1 2 view 0
+ .balign 8
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
diff --git a/gas/testsuite/gas/elf/dwarf2-18.d b/gas/testsuite/gas/elf/dwarf2-18.d
new file mode 100644
index 0000000..08f1af8
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-18.d
@@ -0,0 +1,19 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 18
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 0100 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-18\.c:
+File name *Line number *Starting address *View
+dwarf2-18\.c *1 *0
+dwarf2-18\.c *2 *0 *1
+dwarf2-18\.c *3 *0x4
+dwarf2-18\.c *3 *0x8
diff --git a/gas/testsuite/gas/elf/dwarf2-18.s b/gas/testsuite/gas/elf/dwarf2-18.s
new file mode 100644
index 0000000..9e5e210
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-18.s
@@ -0,0 +1,33 @@
+/* Test view numbering after view-less .loc.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-18.c"
+ .text
+ .balign 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-18.c"
+ .loc 1 1
+ .loc 1 2 view .L1
+ .dc.l 0
+ .loc 1 3 view .L2
+ .dc.l 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
+ .uleb128 .L2
diff --git a/gas/testsuite/gas/elf/dwarf2-2.d b/gas/testsuite/gas/elf/dwarf2-2.d
index b42a2ec..8cc1c3b 100644
--- a/gas/testsuite/gas/elf/dwarf2-2.d
+++ b/gas/testsuite/gas/elf/dwarf2-2.d
@@ -71,7 +71,7 @@ Raw dump of debug contents of section .[z]?debug_line:
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Advance Line by 3 to 4
\[0x.*\] Copy
- \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/elf/dwarf2-5.d b/gas/testsuite/gas/elf/dwarf2-5.d
new file mode 100644
index 0000000..6525c2e
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-5.d
@@ -0,0 +1,79 @@
+#as:
+#readelf: -x.rodata -wlL
+#name: DWARF2 5
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 rx and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The mep target tries to relay code sections which breaks symbolic view computations.
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* rx-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01010201 010203 *.*
+
+Raw dump of debug contents of section \.debug_line:
+
+ Offset: 0x0
+ Length: [0-9]*
+ DWARF Version: 2
+ Prologue Length: [0-9]*
+ Minimum Instruction Length: [0-9]*
+ Initial value of 'is_stmt': 1
+ Line Base: [-0-9]*
+ Line Range: [0-9]*
+ Opcode Base: [0-9]*
+
+ Opcodes:
+ Opcode 1 has 0 args
+ Opcode 2 has 1 args
+ Opcode 3 has 1 args
+ Opcode 4 has 1 args
+ Opcode 5 has 1 args
+ Opcode 6 has 0 args
+ Opcode 7 has 0 args
+ Opcode 8 has 0 args
+ Opcode 9 has 1 args
+ Opcode 10 has 0 args
+ Opcode 11 has 0 args
+ Opcode 12 has 1 args
+
+ The Directory Table is empty.
+
+ The File Name Table \(offset 0x1c\):
+ Entry Dir Time Size Name
+ 1 0 0 0 dwarf2-5\.c
+
+ Line Number Statements:
+ \[0x.*\] Extended opcode 2: set Address to 0x0
+ \[0x.*\] Copy
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x0 and Line by 1 to 2 \(view 1\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 4 to 0x4 and Line by 1 to 3
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x4 and Line by 1 to 4 \(view 1\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x4 and Line by 1 to 5 \(view 2\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 4 to 0x8 and Line by 1 to 6
+ \[0x.*\] Special opcode [0-9]*: advance Address by 4 to 0xc and Line by 1 to 7
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0xc and Line by 1 to 8 \(view 1\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 4 to 0x10 and Line by 1 to 9
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x10 and Line by 1 to 10 \(view 1\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x10 and Line by 1 to 11 \(view 2\)
+ \[0x.*\] Special opcode [0-9]*: advance Address by 0 to 0x10 and Line by 1 to 12 \(view 3\)
+ \[0x.*\] Advance PC by 4 to 0x14
+ \[0x.*\] Extended opcode 1: End of Sequence
+
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-5\.c:
+File name *Line number *Starting address *View
+dwarf2-5\.c *1 *0
+dwarf2-5\.c *2 *0 *1
+dwarf2-5\.c *3 *0x4
+dwarf2-5\.c *4 *0x4 *1
+dwarf2-5\.c *5 *0x4 *2
+dwarf2-5\.c *6 *0x8
+dwarf2-5\.c *7 *0xc
+dwarf2-5\.c *8 *0xc *1
+dwarf2-5\.c *9 *0x10
+dwarf2-5\.c *10 *0x10 *1
+dwarf2-5\.c *11 *0x10 *2
+dwarf2-5\.c *12 *0x10 *3
+dwarf2-5\.c *12 *0x14
diff --git a/gas/testsuite/gas/elf/dwarf2-5.s b/gas/testsuite/gas/elf/dwarf2-5.s
new file mode 100644
index 0000000..3e58239
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-5.s
@@ -0,0 +1,58 @@
+/* Test view numbering.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-5.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-5.c"
+ .loc 1 1 view 0
+ .loc 1 2 view .L2
+ .dc.l 0
+ .loc 1 3 view 0
+ .balign 4
+ .loc 1 4 view .L4
+ .loc 1 5 view .L5
+ .org .+1
+ .balign 4
+ .loc 1 6 view 0
+ .dc.l 0
+ .text
+ .globl func
+ .type func, %function
+func:
+ .loc 1 7 view 0
+ .loc 1 8 view .L8
+ .dc.l 0
+ .loc 1 9 view 0
+ .loc 1 10 view .L10
+ .pushsection .text
+ .loc 1 11 view .L11
+ .popsection
+ .loc 1 12 view .L12
+ .dc.l 0
+ .size func, .-func
+
+ .section .rodata
+ .uleb128 .L2
+ .uleb128 .L4
+ .uleb128 .L5
+ .uleb128 .L8
+ .uleb128 .L10
+ .uleb128 .L11
+ .uleb128 .L12
diff --git a/gas/testsuite/gas/elf/dwarf2-6.d b/gas/testsuite/gas/elf/dwarf2-6.d
new file mode 100644
index 0000000..93489d6
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-6.d
@@ -0,0 +1,78 @@
+#as:
+#readelf: -wlL
+#name: DWARF2 6
+# These targets either do not support or do not evaluate the subtraction of symbols at assembly time
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* xtensa-*
+
+Raw dump of debug contents of section .debug_line:
+
+ Offset: 0x0
+ Length: 84
+ DWARF Version: 2
+ Prologue Length: 36
+ Minimum Instruction Length: 1
+ Initial value of 'is_stmt': 1
+ Line Base: 1
+ Line Range: 1
+ Opcode Base: 16
+
+ Opcodes:
+ Opcode 1 has 0 args
+ Opcode 2 has 1 args
+ Opcode 3 has 1 args
+ Opcode 4 has 1 args
+ Opcode 5 has 1 args
+ Opcode 6 has 0 args
+ Opcode 7 has 0 args
+ Opcode 8 has 0 args
+ Opcode 9 has 1 args
+ Opcode 10 has 0 args
+ Opcode 11 has 0 args
+ Opcode 12 has 1 args
+ Opcode 13 has 0 args
+ Opcode 14 has 0 args
+ Opcode 15 has 0 args
+
+ The Directory Table is empty.
+
+ The File Name Table \(offset 0x1f\):
+ Entry Dir Time Size Name
+ 1 0 0 0 dwarf2-6\.c
+
+
+ Line Number Statements:
+ \[0x.*\] Extended opcode 2: set Address to 0x0
+ \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
+ \[0x.*\] Extended opcode 2: set Address to 0x1
+ \[0x.*\] Copy
+ \[0x.*\] Advance PC by 0 to 0x1
+ \[0x.*\] Copy \(view 1\)
+ \[0x.*\] Advance PC by 1 to 0x2
+ \[0x.*\] Copy
+ \[0x.*\] Advance PC by fixed size amount 1 to 0x3
+ \[0x.*\] Copy \(view 1\)
+ \[0x.*\] Special opcode 0: advance Address by 0 to 0x3 and Line by 1 to 2 \(view 2\)
+ \[0x.*\] Special opcode 1: advance Address by 1 to 0x4 and Line by 1 to 3
+ \[0x.*\] Copy \(view 1\)
+ \[0x.*\] Advance PC by constant 239 to 0xf3
+ \[0x.*\] Copy
+ \[0x.*\] Extended opcode 2: set Address to 0x100
+ \[0x.*\] Extended opcode 1: End of Sequence
+
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-6\.c:
+File name *Line number *Starting address *View
+dwarf2-6\.c *1 *0
+dwarf2-6\.c *1 *0 *1
+dwarf2-6\.c *1 *0x1
+dwarf2-6\.c *1 *0x1 *1
+dwarf2-6\.c *1 *0x2
+dwarf2-6\.c *1 *0x3 *1
+dwarf2-6\.c *2 *0x3 *2
+dwarf2-6\.c *3 *0x4
+dwarf2-6\.c *3 *0x4 *1
+dwarf2-6\.c *3 *0xf3
+dwarf2-6\.c *3 *0x100
diff --git a/gas/testsuite/gas/elf/dwarf2-6.s b/gas/testsuite/gas/elf/dwarf2-6.s
new file mode 100644
index 0000000..28b1829
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-6.s
@@ -0,0 +1,101 @@
+/* Test view number decoding.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-6.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+.L_start:
+ .org .+256
+.Lend_start:
+
+ .section .debug_line,"",%progbits
+ .4byte .Lline_end - .Lline_start /* Initial length. */
+.Lline_start:
+ .2byte 2 /* Dwarf Version. */
+ .4byte .Lline_lines - .Lline_hdr
+.Lline_hdr:
+ .byte 1 /* Minimum insn length. */
+ .byte 1 /* Default is_stmt. */
+ .byte 1 /* Line base. */
+ .byte 1 /* Line range. */
+ .byte 0x10 /* Opcode base. */
+
+ /* Standard lengths. */
+ .byte 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0
+
+ .byte 0 /* Include directories. */
+
+ /* File names. */
+ .ascii "dwarf2-6.c\0"
+ .uleb128 0, 0, 0
+
+ .byte 0
+
+.Lline_lines:
+ .byte 0 /* DW_LNS_extended_op. */
+ .uleb128 5
+ .byte 2 /* DW_LNE_set_address. */
+ .4byte .L_start
+
+ .byte 1 /* DW_LNS_copy view 0. */
+
+ .byte 1 /* DW_LNS_copy view 1. */
+
+ .byte 0 /* DW_LNS_extended_op. */
+ .uleb128 5
+ .byte 2 /* DW_LNE_set_address. */
+ .4byte .L_start+1
+
+ .byte 1 /* DW_LNS_copy view 0. */
+
+ .byte 2 /* DW_LNS_advance_pc by 0. */
+ .uleb128 0
+
+ .byte 1 /* DW_LNS_copy view 1. */
+
+ .byte 2 /* DW_LNS_advance_pc by 1 (reset view). */
+ .uleb128 1
+
+ .byte 1 /* DW_LNS_copy view 0. */
+
+ .byte 9 /* DW_LNS_fixed_advance_pc by 1. */
+ .2byte 1 /* This opcode does NOT reset view. */
+
+ .byte 1 /* DW_LNS_copy view 1. */
+
+ .byte 16 /* Special opcode 0, PC+=0, Line+=1, view 2. */
+
+ .byte 17 /* Special opcode 1, PC+=1 (reset view), Line+=1. */
+
+ .byte 1 /* DW_LNS_copy view 1. */
+
+ .byte 8 /* DW_LNS_const_add_pc by 239 (reset view). */
+
+ .byte 1 /* DW_LNS_copy view 0. */
+
+ .byte 0 /* DW_LNS_extended_op. */
+ .uleb128 5
+ .byte 2 /* DW_LNE_set_address. */
+ .4byte .Lend_start
+
+ .byte 0 /* DW_LNS_extended_op. */
+ .uleb128 1
+ .byte 1 /* DW_LEN_end_of_sequence. */
+
+.Lline_end:
diff --git a/gas/testsuite/gas/elf/dwarf2-7.d b/gas/testsuite/gas/elf/dwarf2-7.d
new file mode 100644
index 0000000..8782d6b
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-7.d
@@ -0,0 +1,19 @@
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 7
+# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time
+# The riscv targets do not support the subtraction of symbols.
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
+
+Hex dump of section '\.rodata':
+ 0x00000000 01 *.*
+
+Decoded dump of debug contents of section \.debug_line:
+
+CU: dwarf2-7\.c:
+File name *Line number *Starting address *View
+dwarf2-7\.c *1 *0
+dwarf2-7\.c *2 *0
+dwarf2-7\.c *3 *0 *1
+dwarf2-7\.c *3 *0x.
diff --git a/gas/testsuite/gas/elf/dwarf2-7.s b/gas/testsuite/gas/elf/dwarf2-7.s
new file mode 100644
index 0000000..e96e64e
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-7.s
@@ -0,0 +1,36 @@
+/* Test view numbering forced reset.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-7.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-7.c"
+ .loc 1 1 view 0
+
+ .section .rodata
+ .uleb128 .L1
+
+ .text
+ .globl func
+ .type func, %function
+func:
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .dc.l 0
+ .size func, .-func
diff --git a/gas/testsuite/gas/elf/dwarf2-8.d b/gas/testsuite/gas/elf/dwarf2-8.d
new file mode 100644
index 0000000..455079d
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-8.d
@@ -0,0 +1,5 @@
+#as:
+#name: DWARF2 8
+#error-output: dwarf2-8.l
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: tile*-*
diff --git a/gas/testsuite/gas/elf/dwarf2-8.l b/gas/testsuite/gas/elf/dwarf2-8.l
new file mode 100644
index 0000000..60c73e5
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-8.l
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:25: Error: view number mismatch
diff --git a/gas/testsuite/gas/elf/dwarf2-8.s b/gas/testsuite/gas/elf/dwarf2-8.s
new file mode 100644
index 0000000..228063c
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-8.s
@@ -0,0 +1,27 @@
+/* Test view numbering zero-assert checking, same frag.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-8.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-8.c"
+ .loc 1 1 view 0
+ .loc 1 2 view 0
+ .int 0
+ .size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-9.d b/gas/testsuite/gas/elf/dwarf2-9.d
new file mode 100644
index 0000000..ebf11cb
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-9.d
@@ -0,0 +1,5 @@
+#as:
+#name: DWARF2 9
+#error-output: dwarf2-9.l
+# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
+#not-target: tile*-*
diff --git a/gas/testsuite/gas/elf/dwarf2-9.l b/gas/testsuite/gas/elf/dwarf2-9.l
new file mode 100644
index 0000000..fb44774
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-9.l
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*.* Error: view number mismatch
diff --git a/gas/testsuite/gas/elf/dwarf2-9.s b/gas/testsuite/gas/elf/dwarf2-9.s
new file mode 100644
index 0000000..afc2019
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf2-9.s
@@ -0,0 +1,32 @@
+/* Test view numbering zero-assert checking, different frag.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "dwarf2-9.c"
+ .text
+ .balign 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-9.c"
+ .loc 1 1 view 0
+
+ .section .rodata
+ .uleb128 0
+
+ .text
+ .loc 1 2 view 0
+ .int 0
+ .size _start, .-_start
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 6b2b31a..c04c74b 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -220,6 +220,20 @@ if { [is_elf_format] } then {
run_dump_test "dwarf2-2"
run_dump_test "dwarf2-3"
run_dump_test "dwarf2-4"
+ run_dump_test "dwarf2-5"
+ run_dump_test "dwarf2-6"
+ run_dump_test "dwarf2-7"
+ run_dump_test "dwarf2-8"
+ run_dump_test "dwarf2-9"
+ run_dump_test "dwarf2-10"
+ run_dump_test "dwarf2-11"
+ run_dump_test "dwarf2-12"
+ run_dump_test "dwarf2-13"
+ run_dump_test "dwarf2-14"
+ run_dump_test "dwarf2-15"
+ run_dump_test "dwarf2-16"
+ run_dump_test "dwarf2-17"
+ run_dump_test "dwarf2-18"
run_dump_test "bss"
run_dump_test "bad-bss"
run_dump_test "bad-section-flag"
diff --git a/gas/testsuite/gas/i386/dw2-compress-1.d b/gas/testsuite/gas/i386/dw2-compress-1.d
index ceebb3f..bfd4837 100644
--- a/gas/testsuite/gas/i386/dw2-compress-1.d
+++ b/gas/testsuite/gas/i386/dw2-compress-1.d
@@ -97,7 +97,7 @@ Raw dump of debug contents of section .z?debug_line:
\[0x.*\] Extended opcode 2: set Address to 0x0
\[0x.*\] Advance Line by 3 to 4
\[0x.*\] Copy
- \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
\[0x.*\] Extended opcode 2: set Address to 0x4
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/i386/dw2-compressed-1.d b/gas/testsuite/gas/i386/dw2-compressed-1.d
index f4c110d..0a2a092 100644
--- a/gas/testsuite/gas/i386/dw2-compressed-1.d
+++ b/gas/testsuite/gas/i386/dw2-compressed-1.d
@@ -98,7 +98,7 @@ Raw dump of debug contents of section .debug_line:
\[0x.*\] Extended opcode 2: set Address to 0x0
\[0x.*\] Advance Line by 3 to 4
\[0x.*\] Copy
- \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
\[0x.*\] Extended opcode 2: set Address to 0x4
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/i386/ilp32/lns/lns-duplicate.d b/gas/testsuite/gas/i386/ilp32/lns/lns-duplicate.d
index c4e5c6f..fc0f861 100644
--- a/gas/testsuite/gas/i386/ilp32/lns/lns-duplicate.d
+++ b/gas/testsuite/gas/i386/ilp32/lns/lns-duplicate.d
@@ -7,5 +7,5 @@ Raw dump of debug contents of section \.z?debug_line:
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Copy
\[0x.*\] Set basic block
- \[0x.*\] .* by 1 to 2
+ \[0x.*\] .* by 1 to 2 \(view 1\)
#pass
diff --git a/gas/testsuite/gas/lns/lns-big-delta.d b/gas/testsuite/gas/lns/lns-big-delta.d
index d86f434..65e0ce1 100644
--- a/gas/testsuite/gas/lns/lns-big-delta.d
+++ b/gas/testsuite/gas/lns/lns-big-delta.d
@@ -8,7 +8,7 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Copy
\[0x.*\] Advance Line by 1 to 2
\[0x.*\] Advance PC by fixed size amount 0 to 0x0
- \[0x.*\] Copy
+ \[0x.*\] Copy \(view 1\)
\[0x.*\] Advance Line by 1 to 3
\[0x.*\] Extended opcode 2: set Address to 0x.*
\[0x.*\] Copy
diff --git a/gas/testsuite/gas/lns/lns-common-1-alt.d b/gas/testsuite/gas/lns/lns-common-1-alt.d
index e762b83..8aa8c73 100644
--- a/gas/testsuite/gas/lns/lns-common-1-alt.d
+++ b/gas/testsuite/gas/lns/lns-common-1-alt.d
@@ -7,37 +7,37 @@ Raw dump of debug contents of section \.debug_line:
#...
Line Number Statements:
\[0x.*\] Extended opcode 2: set Address to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 1\)|)
\[0x.*\] Set column to 3
\[0x.*\] Advance Line by 1 to 2
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 1\)|)
\[0x.*\] Set prologue_end to true
\[0x.*\] Advance Line by 1 to 3
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 2\)|)
\[0x.*\] Set column to 0
\[0x.*\] Set epilogue_begin to true
\[0x.*\] Advance Line by 1 to 4
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 3\)|)
\[0x.*\] Set ISA to 1
\[0x.*\] Set basic block
\[0x.*\] Advance Line by 1 to 5
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 4\)|)
\[0x.*\] Set is_stmt to 0
\[0x.*\] Advance Line by 1 to 6
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 5\)|)
\[0x.*\] Set is_stmt to 1
\[0x.*\] Advance Line by 1 to 7
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 6\)|)
\[0x.*\] Extended opcode 4: set Discriminator to 1
\[0x.*\] Advance Line by 0 to 7
\[0x.*\] Advance PC by fixed size amount .* to .*
- \[0x.*\] Copy
+ \[0x.*\] Copy( \(view 7\)|)
\[0x.*\] Advance PC by fixed size amount .* to .*
\[0x.*\] Extended opcode 1: End of Sequence
#...
diff --git a/gas/testsuite/gas/lns/lns-duplicate.d b/gas/testsuite/gas/lns/lns-duplicate.d
index 9fe28ab..6aed5e7 100644
--- a/gas/testsuite/gas/lns/lns-duplicate.d
+++ b/gas/testsuite/gas/lns/lns-duplicate.d
@@ -6,5 +6,5 @@ Raw dump of debug contents of section \.z?debug_line:
\[0x.*\] Extended opcode 2: set Address to .*
\[0x.*\] Copy
\[0x.*\] Set basic block
- \[0x.*\] .* by 1 to 2
+ \[0x.*\] .* by 1 to 2( \(view 1\)|)
#pass
diff --git a/gas/testsuite/gas/mips/loc-swap-2.d b/gas/testsuite/gas/mips/loc-swap-2.d
index ed280a8..6176614 100644
--- a/gas/testsuite/gas/mips/loc-swap-2.d
+++ b/gas/testsuite/gas/mips/loc-swap-2.d
@@ -39,11 +39,11 @@ Raw dump of debug contents of section .debug_line:
Line Number Statements:
\[0x.*\] Extended opcode 2: set Address to 0x0
\[0x.*\] Special opcode 11: advance Address by 0 to 0x0 and Line by 6 to 7
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x0 and Line by 2 to 9
- \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 10
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x0 and Line by 2 to 9 \(view 1\)
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 10 \(view 2\)
\[0x.*\] Special opcode 120: advance Address by 8 to 0x8 and Line by 3 to 13
\[0x.*\] Special opcode 62: advance Address by 4 to 0xc and Line by 1 to 14
- \[0x.*\] Special opcode 6: advance Address by 0 to 0xc and Line by 1 to 15
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0xc and Line by 1 to 15 \(view 1\)
\[0x.*\] Special opcode 119: advance Address by 8 to 0x14 and Line by 2 to 17
\[0x.*\] Advance PC by 4 to 0x18
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/mips/loc-swap-3.d b/gas/testsuite/gas/mips/loc-swap-3.d
index 2e46e04..0610a44 100644
--- a/gas/testsuite/gas/mips/loc-swap-3.d
+++ b/gas/testsuite/gas/mips/loc-swap-3.d
@@ -12,6 +12,6 @@
# Set prologue_end to true
# here
#------------------------------------------------------------------------
-.* Special opcode 6: advance Address by 0 to 0x[01] and Line by 1 to 2
+.* Special opcode 6: advance Address by 0 to 0x[01] and Line by 1 to 2 \(view 1\)
.* Advance PC by .*
.* Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/mips/loc-swap.d b/gas/testsuite/gas/mips/loc-swap.d
index 4e11106..94fe7cd 100644
--- a/gas/testsuite/gas/mips/loc-swap.d
+++ b/gas/testsuite/gas/mips/loc-swap.d
@@ -44,9 +44,9 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 11: advance Address by 0 to 0x0 and Line by 6 to 7
\[0x.*\] Special opcode 63: advance Address by 4 to 0x4 and Line by 2 to 9
\[0x.*\] Special opcode 120: advance Address by 8 to 0xc and Line by 3 to 12
- \[0x.*\] Special opcode 7: advance Address by 0 to 0xc and Line by 2 to 14
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0xc and Line by 2 to 14 \(view 1\)
\[0x.*\] Special opcode 120: advance Address by 8 to 0x14 and Line by 3 to 17
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x14 and Line by 2 to 19
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x14 and Line by 2 to 19 \(view 1\)
\[0x.*\] Special opcode 120: advance Address by 8 to 0x1c and Line by 3 to 22
\[0x.*\] Special opcode 63: advance Address by 4 to 0x20 and Line by 2 to 24
\[0x.*\] Special opcode 120: advance Address by 8 to 0x28 and Line by 3 to 27
@@ -54,7 +54,7 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 120: advance Address by 8 to 0x34 and Line by 3 to 32
\[0x.*\] Special opcode 63: advance Address by 4 to 0x38 and Line by 2 to 34
\[0x.*\] Special opcode 120: advance Address by 8 to 0x40 and Line by 3 to 37
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x40 and Line by 2 to 39
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x40 and Line by 2 to 39 \(view 1\)
\[0x.*\] Special opcode 120: advance Address by 8 to 0x48 and Line by 3 to 42
\[0x.*\] Special opcode 63: advance Address by 4 to 0x4c and Line by 2 to 44
\[0x.*\] Advance PC by 36 to 0x70
diff --git a/gas/testsuite/gas/mips/micromips@loc-swap-2.d b/gas/testsuite/gas/mips/micromips@loc-swap-2.d
index e148f25..9504be7 100644
--- a/gas/testsuite/gas/mips/micromips@loc-swap-2.d
+++ b/gas/testsuite/gas/mips/micromips@loc-swap-2.d
@@ -39,11 +39,11 @@ Raw dump of debug contents of section .debug_line:
Line Number Statements:
\[0x.*\] Extended opcode 2: set Address to 0x1
\[0x.*\] Special opcode 11: advance Address by 0 to 0x1 and Line by 6 to 7
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x1 and Line by 2 to 9
- \[0x.*\] Special opcode 6: advance Address by 0 to 0x1 and Line by 1 to 10
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x1 and Line by 2 to 9 \(view 1\)
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0x1 and Line by 1 to 10 \(view 2\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0x5 and Line by 3 to 13
\[0x.*\] Special opcode 34: advance Address by 2 to 0x7 and Line by 1 to 14
- \[0x.*\] Special opcode 6: advance Address by 0 to 0x7 and Line by 1 to 15
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0x7 and Line by 1 to 15 \(view 1\)
\[0x.*\] Special opcode 63: advance Address by 4 to 0xb and Line by 2 to 17
\[0x.*\] Advance PC by 1 to 0xc
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/mips/micromips@loc-swap.d b/gas/testsuite/gas/mips/micromips@loc-swap.d
index 23aedae..1427fee 100644
--- a/gas/testsuite/gas/mips/micromips@loc-swap.d
+++ b/gas/testsuite/gas/mips/micromips@loc-swap.d
@@ -45,9 +45,9 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 11: advance Address by 0 to 0x1 and Line by 6 to 7
\[0x.*\] Special opcode 35: advance Address by 2 to 0x3 and Line by 2 to 9
\[0x.*\] Special opcode 36: advance Address by 2 to 0x5 and Line by 3 to 12
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x5 and Line by 2 to 14
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x5 and Line by 2 to 14 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0x9 and Line by 3 to 17
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x9 and Line by 2 to 19
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x9 and Line by 2 to 19 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0xd and Line by 3 to 22
\[0x.*\] Special opcode 35: advance Address by 2 to 0xf and Line by 2 to 24
\[0x.*\] Special opcode 36: advance Address by 2 to 0x11 and Line by 3 to 27
diff --git a/gas/testsuite/gas/mips/mips16@loc-swap-2.d b/gas/testsuite/gas/mips/mips16@loc-swap-2.d
index 95b9e9c..a4cc000 100644
--- a/gas/testsuite/gas/mips/mips16@loc-swap-2.d
+++ b/gas/testsuite/gas/mips/mips16@loc-swap-2.d
@@ -39,11 +39,11 @@ Raw dump of debug contents of section .debug_line:
Line Number Statements:
\[0x.*\] Extended opcode 2: set Address to 0x1
\[0x.*\] Special opcode 11: advance Address by 0 to 0x1 and Line by 6 to 7
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x1 and Line by 2 to 9
- \[0x.*\] Special opcode 6: advance Address by 0 to 0x1 and Line by 1 to 10
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x1 and Line by 2 to 9 \(view 1\)
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0x1 and Line by 1 to 10 \(view 2\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0x5 and Line by 3 to 13
\[0x.*\] Special opcode 34: advance Address by 2 to 0x7 and Line by 1 to 14
- \[0x.*\] Special opcode 6: advance Address by 0 to 0x7 and Line by 1 to 15
+ \[0x.*\] Special opcode 6: advance Address by 0 to 0x7 and Line by 1 to 15 \(view 1\)
\[0x.*\] Special opcode 35: advance Address by 2 to 0x9 and Line by 2 to 17
\[0x.*\] Advance PC by 1 to 0xa
\[0x.*\] Extended opcode 1: End of Sequence
diff --git a/gas/testsuite/gas/mips/mips16@loc-swap.d b/gas/testsuite/gas/mips/mips16@loc-swap.d
index 4d0c781..9b02346 100644
--- a/gas/testsuite/gas/mips/mips16@loc-swap.d
+++ b/gas/testsuite/gas/mips/mips16@loc-swap.d
@@ -44,9 +44,9 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 11: advance Address by 0 to 0x1 and Line by 6 to 7
\[0x.*\] Special opcode 35: advance Address by 2 to 0x3 and Line by 2 to 9
\[0x.*\] Special opcode 64: advance Address by 4 to 0x7 and Line by 3 to 12
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x7 and Line by 2 to 14
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x7 and Line by 2 to 14 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0xb and Line by 3 to 17
- \[0x.*\] Special opcode 7: advance Address by 0 to 0xb and Line by 2 to 19
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0xb and Line by 2 to 19 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0xf and Line by 3 to 22
\[0x.*\] Special opcode 35: advance Address by 2 to 0x11 and Line by 2 to 24
\[0x.*\] Special opcode 64: advance Address by 4 to 0x15 and Line by 3 to 27
@@ -54,7 +54,7 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 64: advance Address by 4 to 0x1b and Line by 3 to 32
\[0x.*\] Special opcode 35: advance Address by 2 to 0x1d and Line by 2 to 34
\[0x.*\] Special opcode 64: advance Address by 4 to 0x21 and Line by 3 to 37
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x21 and Line by 2 to 39
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x21 and Line by 2 to 39 \(view 1\)
\[0x.*\] Special opcode 92: advance Address by 6 to 0x27 and Line by 3 to 42
\[0x.*\] Special opcode 35: advance Address by 2 to 0x29 and Line by 2 to 44
\[0x.*\] Advance PC by 23 to 0x40
diff --git a/gas/testsuite/gas/mips/mips16e@loc-swap.d b/gas/testsuite/gas/mips/mips16e@loc-swap.d
index 412e45b..7356e3f 100644
--- a/gas/testsuite/gas/mips/mips16e@loc-swap.d
+++ b/gas/testsuite/gas/mips/mips16e@loc-swap.d
@@ -44,9 +44,9 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 11: advance Address by 0 to 0x1 and Line by 6 to 7
\[0x.*\] Special opcode 35: advance Address by 2 to 0x3 and Line by 2 to 9
\[0x.*\] Special opcode 36: advance Address by 2 to 0x5 and Line by 3 to 12
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x5 and Line by 2 to 14
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x5 and Line by 2 to 14 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0x9 and Line by 3 to 17
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x9 and Line by 2 to 19
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x9 and Line by 2 to 19 \(view 1\)
\[0x.*\] Special opcode 64: advance Address by 4 to 0xd and Line by 3 to 22
\[0x.*\] Special opcode 35: advance Address by 2 to 0xf and Line by 2 to 24
\[0x.*\] Special opcode 36: advance Address by 2 to 0x11 and Line by 3 to 27
@@ -54,7 +54,7 @@ Raw dump of debug contents of section \.debug_line:
\[0x.*\] Special opcode 36: advance Address by 2 to 0x15 and Line by 3 to 32
\[0x.*\] Special opcode 35: advance Address by 2 to 0x17 and Line by 2 to 34
\[0x.*\] Special opcode 36: advance Address by 2 to 0x19 and Line by 3 to 37
- \[0x.*\] Special opcode 7: advance Address by 0 to 0x19 and Line by 2 to 39
+ \[0x.*\] Special opcode 7: advance Address by 0 to 0x19 and Line by 2 to 39 \(view 1\)
\[0x.*\] Special opcode 92: advance Address by 6 to 0x1f and Line by 3 to 42
\[0x.*\] Special opcode 35: advance Address by 2 to 0x21 and Line by 2 to 44
\[0x.*\] Advance PC by 31 to 0x40