aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-09-07 11:41:25 +0000
committerRichard Henderson <rth@redhat.com>2005-09-07 11:41:25 +0000
commitbd0eb99b906bd9e11675cf96a196e4044c39282a (patch)
treec1570ec872b360e652df9fec5d42c5ac78449de2 /gas/testsuite
parentb8ee1a6e86e6d9a74a59ef3c251183a10e87311e (diff)
downloadgdb-bd0eb99b906bd9e11675cf96a196e4044c39282a.zip
gdb-bd0eb99b906bd9e11675cf96a196e4044c39282a.tar.gz
gdb-bd0eb99b906bd9e11675cf96a196e4044c39282a.tar.bz2
* dwarf2dbg.c: Include safe-ctype.h.
(DWARF2_LINE_OPCODE_BASE): Bump to 13. (current): Initialize. (dwarf2_emit_insn): Clear DWARF2_FLAG_BASIC_BLOCK, DWARF2_FLAG_PROLOGUE_END, DWARF2_FLAG_EPILOGUE_BEGIN. (dwarf2_directive_file): Cope with invalid filename. (dwarf2_directive_loc): Add handling for basic_block, prologue_end, epilogue_begin, is_stmt, isa. (emit_inc_line_addr): Move line_delta == 0, addr_delta == 0 special case down lower. (process_entries): Handle isa, DWARF2_FLAG_PROLOGUE_END, and DWARF2_FLAG_EPILOGUE_BEGIN. (out_debug_line): Emit sizes for DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin, DW_LNS_set_isa. * dwarf2dbg.h (DWARF2_FLAG_IS_STMT): Rename from DWARF2_FLAG_BEGIN_STMT. (DWARF2_FLAG_BASIC_BLOCK): Rename from DWARF2_FLAG_BEGIN_BLOCK. (DWARF2_FLAG_PROLOGUE_END, DWARF2_FLAG_EPILOGUE_BEGIN): New. (struct dwarf2_line_info): Add isa member. * doc/as.texinfo (LNS directives): New node.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/lns/lns-common-1.d29
-rw-r--r--gas/testsuite/gas/lns/lns-common-1.s16
-rw-r--r--gas/testsuite/gas/lns/lns-diag-1.l11
-rw-r--r--gas/testsuite/gas/lns/lns-diag-1.s26
-rw-r--r--gas/testsuite/gas/lns/lns.exp26
6 files changed, 114 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index eff92aa..4616c8d 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-07 Richard Henderson <rth@redhat.com>
+
+ * gas/lns/lns.exp: New file.
+ * gas/lns/lns-common-1.[sd]: New test.
+ * gas/lns/lns-diag-1.[sl]: New test.
+
2005-09-06 Chao-ying Fu <fu@mips.com>
* gas/mips/mips.exp: Run MT test for mips32r2 only.
diff --git a/gas/testsuite/gas/lns/lns-common-1.d b/gas/testsuite/gas/lns/lns-common-1.d
new file mode 100644
index 0000000..bb250e2
--- /dev/null
+++ b/gas/testsuite/gas/lns/lns-common-1.d
@@ -0,0 +1,29 @@
+#readelf: -wl
+#name: lns-common-1
+Dump of debug contents of section \.debug_line:
+#...
+ DWARF Version: 2
+ Prologue Length: 28
+ Minimum Instruction Length: 1
+ Initial value of 'is_stmt': 1
+ Line Base: -5
+ Line Range: 14
+ Opcode Base: 13
+#...
+ Line Number Statements:
+ Extended opcode 2: set Address to 0x0
+ Copy
+ Set prologue_end to true
+ Special opcode 19: advance Address by .* to .* and Line by 0 to 1
+ Set epilogue_begin to true
+ Special opcode 20: advance Address by .* to .* and Line by 1 to 2
+ Set ISA to 1
+ Set basic block
+ Special opcode 20: advance Address by .* to .* and Line by 1 to 3
+ Set is_stmt to 0
+ Special opcode 19: advance Address by .* to .* and Line by 0 to 3
+ Set is_stmt to 1
+ Special opcode 19: advance Address by .* to .* and Line by 0 to 3
+ Advance PC by .* to .*
+ Extended opcode 1: End of Sequence
+#...
diff --git a/gas/testsuite/gas/lns/lns-common-1.s b/gas/testsuite/gas/lns/lns-common-1.s
new file mode 100644
index 0000000..8d3fec3
--- /dev/null
+++ b/gas/testsuite/gas/lns/lns-common-1.s
@@ -0,0 +1,16 @@
+ .file 1 "foo.c"
+ .loc 1 1
+ nop
+ .loc prologue_end
+ nop
+ .loc epilogue_begin
+ .loc 1 2
+ nop
+ .loc isa 1
+ .loc basic_block
+ .loc 1 3
+ nop
+ .loc is_stmt 0
+ nop
+ .loc is_stmt 1
+ nop
diff --git a/gas/testsuite/gas/lns/lns-diag-1.l b/gas/testsuite/gas/lns/lns-diag-1.l
new file mode 100644
index 0000000..52207ed
--- /dev/null
+++ b/gas/testsuite/gas/lns/lns-diag-1.l
@@ -0,0 +1,11 @@
+.*: Assembler messages:
+.*:2: Error: file number less than one
+.*:3: Error: missing string
+.*:4: Error: file number 1 already allocated
+.*:8: Error: unassigned file number 3
+.*:9: Error: junk at end of line, first unrecognized character is `1'
+.*:12: Error: junk at end of line, first unrecognized character is `0'
+.*:18: Error: is_stmt value not 0 or 1
+.*:19: Error: bad or irreducible absolute expression
+.*:23: Error: isa number less than zero
+.*:26: Error: unknown .loc sub-directive frobnitz
diff --git a/gas/testsuite/gas/lns/lns-diag-1.s b/gas/testsuite/gas/lns/lns-diag-1.s
new file mode 100644
index 0000000..8193559
--- /dev/null
+++ b/gas/testsuite/gas/lns/lns-diag-1.s
@@ -0,0 +1,26 @@
+ .file 1 "foo.c"
+ .file 0 "bar.c"
+ .file 2 baz.c
+ .file 1 "bar.c"
+
+ .loc 1 1
+ .loc 1 2 3
+ .loc 3 1
+ .loc 1 1 1 1
+
+ .loc basic_block
+ .loc basic_block 0
+ .loc prologue_end
+ .loc epilogue_begin
+
+ .loc is_stmt 0
+ .loc is_stmt 1
+ .loc is_stmt 2
+ .loc is_stmt foo
+
+ .loc isa 1
+ .loc isa 2
+ .loc isa -1
+ .loc isa 0
+
+ .loc frobnitz
diff --git a/gas/testsuite/gas/lns/lns.exp b/gas/testsuite/gas/lns/lns.exp
new file mode 100644
index 0000000..784f9a3
--- /dev/null
+++ b/gas/testsuite/gas/lns/lns.exp
@@ -0,0 +1,26 @@
+# ??? This probably shouldn't be replicated here...
+proc run_list_test { name opts } {
+ global srcdir subdir
+ set testname "lns $name"
+ set file $srcdir/$subdir/$name
+ gas_run ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ return
+ }
+ pass $testname
+}
+
+if ![is_elf_format] then {
+ return
+}
+
+run_list_test "lns-diag-1" ""
+
+# ??? Won't work on targets that don't have a bare "nop" insn,
+# which is only ia64, afaik. Perhaps we could arrange for an
+# include file or something that defined a macro...
+if ![istarget ia64*-*-*] {
+ run_dump_test "lns-common-1"
+}