+2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * 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.
+
2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
* testplug2.c (dump_tv_tag): Removed.
putchar ('\n');
break;
case LDPL_WARNING:
- vfinfo (stdout, format, args, TRUE);
- putchar ('\n');
+ {
+ char *newfmt = ACONCAT (("%P: warning: ", format, "\n",
+ (const char *) NULL));
+ vfinfo (stdout, newfmt, args, TRUE);
+ }
break;
case LDPL_FATAL:
case LDPL_ERROR:
default:
{
- char *newfmt = ACONCAT ((level == LDPL_FATAL ? "%P%F: " : "%P%X: ",
- format, "\n", (const char *) NULL));
+ char *newfmt = ACONCAT ((level == LDPL_FATAL ? "%P%F" : "%P%X",
+ ": error: ", format, "\n",
+ (const char *) NULL));
fflush (stdout);
vfinfo (stderr, newfmt, args, TRUE);
fflush (stderr);
static enum ld_plugin_status
parse_option (const char *opt)
{
- if (!strncmp ("fail", opt, 4))
+ if (!strncmp ("fatal", opt, 5))
+ {
+ TV_MESSAGE (LDPL_FATAL, "Fatal error");
+ fflush (NULL);
+ }
+ else if (!strncmp ("error", opt, 5))
+ {
+ TV_MESSAGE (LDPL_ERROR, "Error");
+ fflush (NULL);
+ }
+ else if (!strncmp ("warning", opt, 7))
+ {
+ TV_MESSAGE (LDPL_WARNING, "Warning");
+ fflush (NULL);
+ }
+ else if (!strncmp ("fail", opt, 4))
return set_ret_val (opt + 4, LDPS_ERR);
else if (!strncmp ("pass", opt, 4))
return set_ret_val (opt + 4, LDPS_OK);
+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
--- /dev/null
+.*: error: Fatal error
--- /dev/null
+.*: error: Error
--- /dev/null
+.*: warning: Warning
$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 \