aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-02-11 12:16:07 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-02-11 14:00:51 -0800
commit45e813544eb076dd52fefe7b36e28b088963207d (patch)
treea3954237e7a9dfcf3c529a82eb3007328868fb89 /ld/testsuite
parente3001fd92063282c55ad251d58f112b10a0cf7d6 (diff)
downloadgdb-45e813544eb076dd52fefe7b36e28b088963207d.zip
gdb-45e813544eb076dd52fefe7b36e28b088963207d.tar.gz
gdb-45e813544eb076dd52fefe7b36e28b088963207d.tar.bz2
Output "warning:" or "error:" in plugin messages
When plugin generates LDPL_WARNING, LDPL_FATAL and LDPL_ERROR messages, linker should display "warning:" or "error:" in plugin messages like regular linker messages. ld/ * plugin.c (message): Output "warning:" for LDPL_WARNING. Output "error:" for LDPL_FATAL and LDPL_ERROR. * testplug2.c (parse_option): Handle fatal, error and warning. ld/testsuite/ * ld-plugin/plugin-27.d: New. * ld-plugin/plugin-28.d: Likewise. * ld-plugin/plugin-29.d: Likewise. * plugin.exp (plugin_tests): Add tests for LDPL_FATAL, LDPL_ERROR and LDPL_WARNING.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-plugin/plugin-27.d1
-rw-r--r--ld/testsuite/ld-plugin/plugin-28.d1
-rw-r--r--ld/testsuite/ld-plugin/plugin-29.d1
-rw-r--r--ld/testsuite/ld-plugin/plugin.exp6
5 files changed, 17 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index ea1d533..2b963fa 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
+ * ld-plugin/plugin-27.d: New.
+ * ld-plugin/plugin-28.d: Likewise.
+ * ld-plugin/plugin-29.d: Likewise.
+ * plugin.exp (plugin_tests): Add tests for LDPL_FATAL, LDPL_ERROR
+ and LDPL_WARNING.
+
+2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/17878
* ld-plugin/func.c: Add some comments.
* ld-plugin/plugin-13.d: New file.
diff --git a/ld/testsuite/ld-plugin/plugin-27.d b/ld/testsuite/ld-plugin/plugin-27.d
new file mode 100644
index 0000000..bae8c2c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/plugin-27.d
@@ -0,0 +1 @@
+.*: error: Fatal error
diff --git a/ld/testsuite/ld-plugin/plugin-28.d b/ld/testsuite/ld-plugin/plugin-28.d
new file mode 100644
index 0000000..9052b76
--- /dev/null
+++ b/ld/testsuite/ld-plugin/plugin-28.d
@@ -0,0 +1 @@
+.*: error: Error
diff --git a/ld/testsuite/ld-plugin/plugin-29.d b/ld/testsuite/ld-plugin/plugin-29.d
new file mode 100644
index 0000000..c42bdf2
--- /dev/null
+++ b/ld/testsuite/ld-plugin/plugin-29.d
@@ -0,0 +1 @@
+.*: warning: Warning
diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp
index b832534..35b7bbe 100644
--- a/ld/testsuite/ld-plugin/plugin.exp
+++ b/ld/testsuite/ld-plugin/plugin.exp
@@ -168,6 +168,12 @@ set plugin_tests [list \
$testsrcfiles $libs" "" "" "" {{ld plugin-17.d}} "main.x" ] \
[list "load plugin with source not claimed" "-plugin $plugin_path $regclm \
$testsrcfiles $libs" "" "" "" {{ld plugin-26.d}} "main.x" ] \
+ [list "plugin fatal error" "-plugin $plugin2_path -plugin-opt fatal \
+ $testobjfiles $libs" "" "" "" {{ld plugin-27.d}} "main.x" ] \
+ [list "plugin error" "-plugin $plugin2_path -plugin-opt error \
+ $testobjfiles $libs" "" "" "" {{ld plugin-28.d}} "main.x" ] \
+ [list "plugin warning" "-plugin $plugin2_path -plugin-opt warning \
+ $testobjfiles $libs" "" "" "" {{ld plugin-29.d}} "main.x" ] \
]
set plugin_lib_tests [list \