--- /dev/null
+#as:
+#name: DWARF2 10
+#error-output: dwarf2-10.l
--- /dev/null
+[^:]*: Assembler messages:
+[^:]*: Error: view number mismatch
--- /dev/null
+/* 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
+ .align 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-10.c"
+ .loc 1 1 view 0
+ .align 4 /* No skip needed here... */
+ .loc 1 2 view 0 /* so this zero-view check fails. */
+ .int 0
+ .loc 1 3 view 0
+ .align 8 /* Skip 4 more bytes after .int... */
+ .loc 1 4 view 0 /* so this is a zero view indeed. */
+ .int 0
+ .size _start, .-_start
--- /dev/null
+#as:
+#readelf: -wL
+#name: DWARF2 11
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-11.c"
+ .int 0
+ .loc 1 1 view 0
+ .align 8
+ .loc 1 2 view 0
+ .size _start, .-_start
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 12
+
+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
--- /dev/null
+/* 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
+ .align 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-12.c"
+ .loc 1 1 view 0
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 13
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-13.c"
+ .int 0
+ .loc 1 1 view 0
+ .align 8
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 14
+
+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
--- /dev/null
+/* 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
+ .align 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-14.c"
+ .loc 1 1 view 0
+ .align 4
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 15
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-15.c"
+ .loc 1 1 view 0
+ .int 0
+ .loc 1 2 view -0
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 16
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-16.c"
+ .loc 1 1 view 0
+ .int 0
+ .loc 1 2 view 0
+ .align 4
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 17
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-17.c"
+ .loc 1 1 view 0
+ .int 0
+ .loc 1 2 view 0
+ .align 8
+ .loc 1 3 view .L1
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 18
+
+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
--- /dev/null
+/* 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
+ .align 8
+ .globl _start
+_start:
+ .file 1 "dwarf2-18.c"
+ .loc 1 1
+ .loc 1 2 view .L1
+ .int 0
+ .loc 1 3 view .L2
+ .int 0
+ .size _start, .-_start
+
+ .section .rodata
+ .uleb128 .L1
+ .uleb128 .L2
--- /dev/null
+#as:
+#readelf: -x.rodata -wL
+#name: DWARF2 7
+
+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 *0x4
--- /dev/null
+/* 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
+ .align 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
+ .int 0
+ .size func, .-func
--- /dev/null
+#as:
+#name: DWARF2 8
+#error-output: dwarf2-8.l
--- /dev/null
+[^:]*: Assembler messages:
+[^:]*:26: Error: view number mismatch
--- /dev/null
+/* 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
+ .align 4
+ .globl _start
+_start:
+ .file 1 "dwarf2-8.c"
+ .loc 1 1 view 0
+ .loc 1 2 view 0
+ .int 0
+ .size _start, .-_start
--- /dev/null
+#as:
+#name: DWARF2 9
+#error-output: dwarf2-9.l
--- /dev/null
+[^:]*: Assembler messages:
+[^:]*:31: Error: view number mismatch
--- /dev/null
+/* 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
+ .align 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
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"